TReK C++  5.3.2
Telemetry/Command API
trek::Parameter Class Reference

This class describes a single parameter within a telemetry or command message including its value. More...

#include <parameter.h>

Inherits trek::NamedItem.

Public Member Functions

 Parameter ()
 Default constructor.
 
 Parameter (Parameter &input)
 Copy constructor.
 
virtual ~Parameter ()
 Class destructor. More...
 
int32_t FindLastBit (uint32_t &last_bit)
 Finds the last bit used when building the parameter. More...
 
int32_t Build (uint8_t *input_ptr, uint32_t *last_bit_ptr)
 Builds the parameter and places it in the specified buffer. More...
 
int32_t Extract (uint8_t *input_ptr, uint32_t input_length, uint32_t &last_bit_used)
 Extracts the parameter from the specified buffer. More...
 
ParameterClone ()
 Creates and returns an extact copy of the object.
 
void operator= (Parameter &right_side)
 Provides the equal operator.
 
BaseEnumerator * GetEnumerator ()
 Returns a copy of the enumerator. More...
 
EnumeratorSwitchSetGetEnumeratorSwitchSet ()
 Returns a copy of the enumerator switch set. More...
 
CalibratorGetCalibrator ()
 Returns a copy of the calibrator. More...
 
CalibratorSwitchSetGetCalibratorSwitchSet ()
 Returns a copy of the calibrator switch set. More...
 
LimitAlarmGetLimits ()
 Returns a copy of the limit alarm. More...
 
LimitAlarmSwitchSetGetLimitAlarmSwitchSet ()
 Returns a copy of the limit alarm switch set. More...
 
ExpectedStateAlarmGetExpectedStateAlarm ()
 Returns a copy of the expected state alarm. More...
 
ExpectedStateAlarmSwitchSetGetExpectedStateAlarmSwitchSet ()
 Returns a copy of the expected state alarm switch set. More...
 
void ClearDefaultCalibrator ()
 Removes the default calibrator from the Parameter.
 
void ClearCalibratorSwitchSet ()
 Removes the calibrator switch set from the Parameter.
 
void ClearEnumerator ()
 Removes the enumerator from the Parameter.
 
void ClearEnumeratorSwitchSet ()
 Removes the enumerator switch set from the Parameter.
 
void ClearLimits ()
 Removes limits from the Parameter.
 
void ClearLimitAlarmSwitchSet ()
 Removes the enumerator switch set from the Parameter.
 
void ClearExpectedStateAlarm ()
 Removes expected state alarm from the Parameter.
 
void ClearExpectedStateAlarmSwitchSet ()
 Removes the enumerator switch set from the Parameter.
 
void Init ()
 Initializes the object. More...
 
virtual const char * GetElementName ()
 The name used for identifying this class in XML.
 
void SetParentPacket (Packet *input)
 Sets the parent of this parameter to allow look up of external dependencies.
 
Configure Methods

These methods configure the parameter object.

int32_t SetDataType (parameter_data_type input_type, uint32_t input_len, byte_order_type input_order=BIG_ENDIAN_BYTE_ORDER, bool var_len=false)
 Sets the data type, length, and byte order for the parameter. More...
 
void SetEngineeringUnits (const char *input_ptr)
 Sets the engineering units for the parameter. More...
 
int32_t SetStartBit (uint32_t input)
 Sets the start location for the parameter as bits. More...
 
int32_t SetNumberOfSamples (uint32_t input)
 Sets the number of samples for the parameter. More...
 
void SetSampleOffset (uint32_t input)
 Sets the sample offset for the parameter. More...
 
int32_t SetNumberOfSyllables (uint32_t input)
 Sets the number of syllables for the parameter. More...
 
int32_t SetSyllableInfo (uint32_t syll_num, uint32_t start_bit, uint32_t length)
 Sets the start bit and length for a syllable in a parameter. More...
 
void SetModifiableFlag (bool input)
 Sets the modifiable flag for the parameter. More...
 
void SetLowRangeFlag (bool input)
 Sets the low range flag for the parameter. More...
 
void SetHighRangeFlag (bool input)
 Sets the high range flag for the parameter. More...
 
int32_t SetIntegerLowRange (int64_t input)
 Sets the low range value for a parameter that is stored as a signed integer (ST_SIGNED_64). More...
 
int32_t SetIntegerHighRange (int64_t input)
 Sets the high range value for a parameter that is stored as a signed integer (ST_SIGNED_64). More...
 
int32_t SetUnsignedLowRange (uint64_t input)
 Sets the low range value for a parameter that is stored as an unsigned integer (ST_UNSIGNED_64). More...
 
int32_t SetUnsignedHighRange (uint64_t input)
 Sets the high range value for a parameter that is stored as an unsigned integer (ST_UNSIGNED_64). More...
 
int32_t SetDoubleLowRange (double input)
 Sets the low range value for a parameter that is stored as a floating point (ST_DOUBLE). More...
 
int32_t SetDoubleHighRange (double input)
 Sets the high range value for a parameter that is stored as a floating point (ST_DOUBLE). More...
 
int32_t AddDependency (Dependency &input)
 Adds a dependency for the parameter. More...
 
void ClearDependencies ()
 Removes all dependencies for a parameter. More...
 
uint32_t GetNumberOfDependencies ()
 Gets the number of dependencies for a parameter. More...
 
DependencyGetDependency (uint32_t num)
 Gets the specified dependency for a parameter. More...
 
void SetEnumerator (Enumerator &input)
 Sets the enumerator to be used for this parameter. More...
 
void SetRangeEnumerator (RangeEnumerator &input)
 Sets the range enumerator to be used for this parameter. More...
 
void SetEnumeratorSwitchSet (EnumeratorSwitchSet *input)
 Sets the enumerator switch set to be used for this parameter. More...
 
void SetEnumeratorSwitchSet (EnumeratorSwitchSet &input)
 Sets the enumerator switch set to be used for this parameter. More...
 
void SetDefaultCalibrator (Calibrator &input)
 Sets the calibrator to be used for this parameter. More...
 
void SetDefaultCalibrator (Calibrator *input)
 Sets the calibrator to be used for this parameter. More...
 
void SetCalibratorSwitchSet (CalibratorSwitchSet &input)
 Sets the calibrator switch set to be used for this parameter. More...
 
void SetCalibratorSwitchSet (CalibratorSwitchSet *input)
 Sets the calibrator switch set to be used for this parameter. More...
 
void SetLimits (LimitAlarm &input)
 Sets the limits to be used for this parameter. More...
 
void SetLimitAlarmSwitchSet (LimitAlarmSwitchSet &input)
 Sets the limit alarm switch set to be used for this parameter. More...
 
void SetExpectedStateAlarm (ExpectedStateAlarm &input)
 Sets the expected state to be used for this parameter. More...
 
void SetExpectedStateAlarmSwitchSet (ExpectedStateAlarmSwitchSet &input)
 Sets the expected state switch set to be used for this parameter. More...
 
void SetFullName (const char *input)
 Sets the full name for the parameter. More...
 
int32_t SetDataFormat (parameter_data_format input)
 Sets the data format for the printing the parameter to a string. More...
 
void SetExternalNumSamplesParameter (const char *name)
 Sets the name of the parameter to use as the number of samples available for the parameter. More...
 
void SetExternalStatusParameter (const char *name)
 Sets the name of the parameter to use as the source status for the parameter. More...
 
void ClearExternalNumSamples ()
 Clears the external number of samples parameter. More...
 
void ClearExternalStatus ()
 Clears the external status parameter. More...
 
const char * GetExternalNumSamplesParameter ()
 Gets the name of the external number of samples parameter. More...
 
const char * GetExternalStatusParameter ()
 Gets the name of the external status parameter. More...
 
void SetCalibrateBeforeAlarmCheck (bool input=true)
 Sets a flag to indicate if alarm checks are performed prior to or after calibration. More...
 
void SetContinueOnRangeError (bool input=false)
 Sets a flag to indicate if processing can continue if a range error is detected. More...
 
void AllowInvalidData ()
 Sets the Parameter to allow invalid combinations of input. More...
 
bool IsValid ()
 Checks to see if a parameter is valid. More...
 
bool Validate (uint32_t &num_errors, uint32_t &num_warnings, const char **validation_messages=0)
 Validates the parameter. More...
 
void SetAutoClear (bool input)
 Sets the auto clear behavior of the parameter instance. More...
 
bool GetAutoClear ()
 Gets the auto clear behavior of the parameter instance. More...
 
Set Value Methods

These methods set the value of the parameter.

int32_t SetValue (int8_t input, uint16_t sample_number=1)
 Sets the value of the parameter with an 8-bit signed integer. More...
 
int32_t SetValue (int16_t input, uint16_t sample_number=1)
 Sets the value of the parameter with a 16-bit signed integer. More...
 
int32_t SetValue (int32_t input, uint16_t sample_number=1)
 Sets the value of the parameter with a 32-bit signed integer. More...
 
int32_t SetValue (int64_t input, uint16_t sample_number=1)
 Sets the value of the parameter with a 64-bit signed integer. More...
 
int32_t SetValue (uint8_t input, uint16_t sample_number=1)
 Sets the value of the parameter with an 8-bit unsigned integer. More...
 
int32_t SetValue (uint16_t input, uint16_t sample_number=1)
 Sets the value of the parameter with a 16-bit unsigned integer. More...
 
int32_t SetValue (uint32_t input, uint16_t sample_number=1)
 Sets the value of the parameter with a 32-bit unsigned integer. More...
 
int32_t SetValue (uint64_t input, uint16_t sample_number=1)
 Sets the value of the parameter with a 64-bit unsigned integer. More...
 
int32_t SetValue (float input, uint16_t sample_number=1)
 Sets the value of the parameter with a 32-bit floating point. More...
 
int32_t SetValue (double input, uint16_t sample_number=1)
 Sets the value of the parameter with a 64-bit floating point. More...
 
int32_t SetValue (bool input, uint16_t sample_number=1)
 Sets the value of the parameter with a boolean. More...
 
int32_t SetValue (const char *input_ptr, uint16_t sample_number=1)
 Sets the value of the parameter with a NULL terminated string. More...
 
int32_t SetValue (uint8_t *input_ptr, uint32_t input_len, uint16_t sample_number=1)
 Sets the value of the parameter with binary data. More...
 
int32_t SetValue (TrekTime &input, uint16_t sample_number=1)
 Sets the value of the parameter with a TrekTime object. More...
 
int32_t SetValueFromString (const char *value_str, parameter_data_format data_fmt, uint16_t sample_number=1)
 Sets the value of the parameter from a string by interpreting the format. More...
 
void ClearValue ()
 Removes the value for the parameter. More...
 
Get Value Methods

These methods get the value of the parameter.

int32_t GetValue (int8_t &input, uint16_t sample_number=1)
 Gets the value of a parameter as an 8-bit signed integer. More...
 
int32_t GetValue (int8_t &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Gets the value of a parameter as an 8-bit signed integer and its associated status. More...
 
int32_t GetValue (int16_t &input, uint16_t sample_number=1)
 Gets the value of a parameter as a 16-bit signed integer. More...
 
int32_t GetValue (int16_t &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Gets the value of a parameter as a 16-bit signed integer and its associated status. More...
 
int32_t GetValue (int32_t &input, uint16_t sample_number=1)
 Gets the value of a parameter as a 32-bit signed integer. More...
 
int32_t GetValue (int32_t &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Gets the value of a parameter as a 32-bit signed integer and its associated status. More...
 
int32_t GetValue (int64_t &input, uint16_t sample_number=1)
 Gets the value of a parameter as a 64-bit signed integer. More...
 
int32_t GetValue (int64_t &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Gets the value of a parameter as a 64-bit signed integer and its associated status. More...
 
int32_t GetValue (uint8_t &input, uint16_t sample_number=1)
 Gets the value of a parameter as an 8-bit unsigned integer. More...
 
int32_t GetValue (uint8_t &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Gets the value of a parameter as an 8-bit unsigned integer and its associated status. More...
 
int32_t GetValue (uint16_t &input, uint16_t sample_number=1)
 Gets the value of a parameter as a 16-bit unsigned integer. More...
 
int32_t GetValue (uint16_t &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Gets the value of a parameter as a 16-bit unsigned integer and its associated status. More...
 
int32_t GetValue (uint32_t &input, uint16_t sample_number=1)
 Gets the value of a parameter as a 32-bit unsigned integer. More...
 
int32_t GetValue (uint32_t &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Gets the value of a parameter as a 32-bit unsigned integer and its associated status. More...
 
int32_t GetValue (uint64_t &input, uint16_t sample_number=1)
 Gets the value of a parameter as a 64-bit unsigned integer. More...
 
int32_t GetValue (uint64_t &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Gets the value of a parameter as a 64-bit unsigned integer and its associated status. More...
 
int32_t GetValue (float &input, uint16_t sample_number=1)
 Gets the value of a parameter as a 32-bit floating point. More...
 
int32_t GetValue (float &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Gets the value of a parameter as a 32-bit floating point and its associated status. More...
 
int32_t GetValue (double &input, uint16_t sample_number=1)
 Gets the value of a parameter as a 64-bit floating point. More...
 
int32_t GetValue (double &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Gets the value of a parameter as a 64-bit floating point and its associated status. More...
 
int32_t GetValue (bool &input, uint16_t sample_number=1)
 Gets the value of a parameter as a boolean. More...
 
int32_t GetValue (bool &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Gets the value of a parameter as a boolean and its associated status. More...
 
int32_t GetValue (char *input_ptr, uint32_t length, uint16_t sample_number=1)
 Gets the value of a parameter as a char array. More...
 
int32_t GetValue (char *input_ptr, uint32_t length, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Gets the value of a parameter as a char array. More...
 
int32_t GetValue (TrekTime &input, uint16_t sample_number=1)
 Gets the value of a parameter as a TrekTime. More...
 
int32_t GetValue (TrekTime &input, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Gets the value of a parameter as a TrekTime. More...
 
int32_t GetValue (uint8_t *input_ptr, uint32_t *num_bits_ptr, uint16_t sample_number=1)
 Gets the "raw" value of a parameter. More...
 
int32_t GetValue (uint8_t *input_ptr, uint32_t *num_bits_ptr, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Gets the "raw" value of a parameter and its associated status. More...
 
int32_t GetEnumeratedValue (char *output_str, uint32_t *size_of_output, uint16_t sample_number=1)
 Get the enumerated value for a parameter. More...
 
int32_t GetEnumeratedValue (char *output_str, uint32_t *size_of_output, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Gets the enumerated value of a parameter and its associated status. More...
 
int32_t GetCalibratedValue (double &output, uint16_t sample_number=1)
 Gets the calibrated value of a parameter as a 64-bit floating point. More...
 
int32_t GetCalibratedValue (double &output, uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Gets the calibrated value of a parameter as a 64-bit floating point and its associated status. More...
 
const char * GetValueAsString (uint16_t sample_number=1)
 Returns the value of the parameter as a string. More...
 
const char * GetValueAsString (uint32_t &trek_status, uint32_t &src_status, uint16_t sample_number=1)
 Returns the value of the parameter as a string and its associated status. More...
 
- Public Member Functions inherited from trek::NamedItem
void SetName (const char *input_ptr)
 Sets the name of the item. More...
 
void SetAlias (const char *input)
 Sets the alias of the item. More...
 
void SetShortDescription (const char *input_ptr)
 Sets the short description of the item. More...
 
void SetLongDescription (const char *input_ptr)
 Sets the long description of the item. More...
 
void SetUserDescription (const char *input_ptr)
 Sets the user description of the item. More...
 
void SetOwner (const char *input_ptr)
 Sets the owner of the item. More...
 
const char * GetName ()
 Returns the name of the item.
 
const char * GetAlias ()
 Returns the alias of the item.
 
const char * GetShortDescription ()
 Returns the short description of the item.
 
const char * GetLongDescription ()
 Returns the long description of the item.
 
const char * GetUserDescription ()
 Returns the user description of the item.
 
const char * GetOwner ()
 Returns the owner of the item.
 
 NamedItem ()
 Default constructor of the class.
 
 NamedItem (NamedItem &input)
 Copy constructor of the class.
 
virtual ~NamedItem ()
 Class destructor. More...
 
void operator= (NamedItem &right_side)
 Provides the equal operator.
 
bool operator== (NamedItem &right_side)
 Provides the == operator.
 

Figure Methods

These methods help you figure out how the parameter is configured.

parameter_data_type GetDataType ()
 Gets the data type for the parameter. More...
 
uint32_t GetLength ()
 Gets the length of the parameter. More...
 
const char * GetEngineeringUnits ()
 Gets the engineering units of the parameter. More...
 
uint32_t GetStartBit ()
 Gets the start bit of the parameter. More...
 
byte_order_type GetByteOrder ()
 Gets the byte order for the parameter. More...
 
uint32_t GetNumberOfSamples ()
 Gets the number of samples for the parameter. More...
 
uint32_t GetSampleOffset ()
 Gets the sample offset for the parameter. More...
 
uint32_t GetNumberOfSyllables ()
 Gets the number of syllables for the parameter. More...
 
int32_t GetSyllableInfo (uint32_t syll_num, uint32_t &start_bit, uint32_t &length)
 Gets the start bit and length for a syllable in a parameter. More...
 
const char * GetFullName ()
 Returns the full name for the parameter.
 
parameter_data_format GetDataFormat ()
 Returns the data format enumeration.
 
const char * GetDataTypeAsString ()
 Returns the data type for the parameter as a string. More...
 
const char * GetByteOrderAsString ()
 Returns the byte order for the parameter as a string. More...
 
const char * GetDataFormatAsString ()
 Returns the data format for the parameter as a string. More...
 
bool IsVariableLength ()
 Identifies if the parameter can have a variable length. More...
 
bool IsModifiable ()
 Identifies if the parameter can be modified. More...
 
bool HasValue ()
 Identifies if the parameter currently has a value. More...
 
bool HasLimits ()
 Identifies if the parameter currently has limits defined. More...
 
bool HasExpectedState ()
 Identifies if the parameter currently has an expected state defined. More...
 
bool HasEnumerator ()
 Identifies if the parameter currently has an enumerator defined. More...
 
bool HasCalibrator ()
 Identifies if the parameter currently has calibration defined. More...
 
bool UseLowRange ()
 Identifies if a low range value is currently in use. More...
 
bool UseHighRange ()
 Identifies if a high range value is currently in use. More...
 
int64_t GetIntegerLowRange ()
 Returns the low range value of a data type that is stored as a signed integer (ST_SIGNED_64). More...
 
int64_t GetIntegerHighRange ()
 Returns the high range value of a data type that is stored as a signed integer (ST_SIGNED_64). More...
 
uint64_t GetUnsignedLowRange ()
 Returns the low range value of a data type that is stored as an unsigned integer (ST_UNSIGNED_64). More...
 
uint64_t GetUnsignedHighRange ()
 Returns the high range value of a data type that is stored as an unsigned integer (ST_UNSIGNED_64). More...
 
double GetDoubleLowRange ()
 Returns the low range value of a data type that is stored as a double (ST_DOUBLE). More...
 
double GetDoubleHighRange ()
 Returns the high range value of a data type that is stored as a double (ST_DOUBLE). More...
 
bool GetCalibrateBeforeAlarmCheck ()
 Identifies if the parameter value is calibrated prior to alarm checking the value. More...
 
bool GetContinueOnRangeError ()
 Identifies if parameter processing will continue on a range error. More...
 

Serialization Methods

These methods help read and write the class to disk or memory. Most users will not be interested in these. Those that are can continue reading.

int32_t LoadFile (const char *filename)
 Loads the Parameter definition from the specified file. More...
 
int32_t SaveFile (const char *filename)
 Saves the Parameter definition to the specified file. More...
 

Detailed Description

This class describes a single parameter within a telemetry or command message including its value.

The parameter can have one or more samples. Most users will only use the Get/Set value methods along with Build and Extract.

Note
The precision shown when printing floating point values as string with methods in this class will be different for Windows and Linux.
Examples
build_packet/build_packet.cpp, cmd_api_cpp/cmd_api_cpp_main.cpp, define_packet/define_packet.cpp, extract_packet/extract_packet.cpp, integrate_user_calibrator/integrate_user_calibrator.cpp, and tlm_api_cpp_newest/cpp_newest_main.cpp.

Constructor & Destructor Documentation

◆ ~Parameter()

trek::Parameter::~Parameter ( )
virtual

Class destructor.

Removes all resources created with this instance of the class.

Member Function Documentation

◆ AddDependency()

int32_t trek::Parameter::AddDependency ( Dependency input)

Adds a dependency for the parameter.

Adds the dependency specified for this parameter. If all dependency checks are positive, the parameter will be placed in the packet (Packet::Build()) or retrieved from the packet (Packet::Extract()).

Parameters
[in]inputThe dependency to add.
Returns
SUCCESS

Example:

// parameter will be in packet if the parameter named "counter" has a
// value that when divided by 2 has a remainder of 1.
cd.Configure( "counter", 2, 1 );
ret_value = p.AddDependency( cd );
if( ret_value )
; // process error (none at this time, but that can change
This class determine a parameter's dependency based on a counter.
Definition: counter_dependency.h:18
int32_t Configure(const char *name, uint32_t mod_value, uint32_t remainder_value)
Configures the counter dependency.
Definition: counter_dependency.cpp:90
This class describes a single parameter within a telemetry or command message including its value.
Definition: parameter.h:95
int32_t AddDependency(Dependency &input)
Adds a dependency for the parameter.
Definition: parameter.cpp:1886

◆ AllowInvalidData()

void trek::Parameter::AllowInvalidData ( )

Sets the Parameter to allow invalid combinations of input.

The Parameter class by default will not allow invalid input. Calling this method will allow invalid data, but will require that the Parameter::Validate() method returns true prior to using many of the other methods (e.g., GetValue(), Build(), ToXml()). This allows input of data in any order.

Example:

const char *msg;
p.SetDataFormat( DF_DATA_TIME ); // would normally fail as default data type is unsigned integer
if( p.IsValid() )
printf( "This shouldn't occur since Validate must be called to check.\n" );
if( p.Validate( &msg ) )
printf( "Parameter is ok\n" );
else
{
// invalid data print the errors
printf( "%s\n", msg );
}
// now this function might succeed
if( p.IsValid() )
printf( "Parameter is valid.\n" );
int32_t SetDataFormat(parameter_data_format input)
Sets the data format for the printing the parameter to a string.
Definition: parameter.cpp:2881
int32_t SetDataType(parameter_data_type input_type, uint32_t input_len, byte_order_type input_order=BIG_ENDIAN_BYTE_ORDER, bool var_len=false)
Sets the data type, length, and byte order for the parameter.
Definition: parameter.cpp:1401
bool Validate(uint32_t &num_errors, uint32_t &num_warnings, const char **validation_messages=0)
Validates the parameter.
Definition: parameter.cpp:756
void AllowInvalidData()
Sets the Parameter to allow invalid combinations of input.
Definition: parameter.cpp:679
bool IsValid()
Checks to see if a parameter is valid.
Definition: parameter.cpp:713
@ DT_UNIX_TIME
32 bits seconds since midnight January 1, 1970
Definition: parameter.h:56

◆ Build()

int32_t trek::Parameter::Build ( uint8_t *  input_ptr,
uint32_t *  last_bit_ptr 
)

Builds the parameter and places it in the specified buffer.

The parameter is converted to the data type specified from the local representation of the data. The last bit used in the buffer is returned as last_bit_ptr. The data is placed according to the start bit, length, number of samples, and sample offset.

Note
It is not expected that users will want to use this method directly.
Parameters
[out]input_ptrThe buffer to place the parameter.
[out]last_bit_ptrSet to the last bit used if SUCCESS is returned.
Returns
SUCCESS
TREK_DATA_NO_VALUE
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_NULL_PTR

Example:

int32_t ret_value;
unsigned char buf[100];
uint32_t last_bit;
ret_value = p.Build( buf, &last_bit );
if( ret_value )
{
// process error
}
else
{
// parameter place in buffer
}
int32_t Build(uint8_t *input_ptr, uint32_t *last_bit_ptr)
Builds the parameter and places it in the specified buffer.
Definition: parameter.cpp:3772

◆ ClearDependencies()

void trek::Parameter::ClearDependencies ( )

Removes all dependencies for a parameter.

Parameter will always appear in the packet when dependencies are removed.

Example:

void ClearDependencies()
Removes all dependencies for a parameter.
Definition: parameter.cpp:1915

◆ ClearExternalNumSamples()

void trek::Parameter::ClearExternalNumSamples ( )

Clears the external number of samples parameter.

The value set by SetNumberOfSamples will be used to retrieve data.

◆ ClearExternalStatus()

void trek::Parameter::ClearExternalStatus ( )

Clears the external status parameter.

The source status returned from calls to GetValue() will always be 0.

◆ ClearValue()

void trek::Parameter::ClearValue ( )

Removes the value for the parameter.

This can be used as a cheat to get around parameters that aren't modifiable.

◆ Extract()

int32_t trek::Parameter::Extract ( uint8_t *  input_ptr,
uint32_t  input_length,
uint32_t &  last_bit_used 
)

Extracts the parameter from the specified buffer.

The parameter is converted from the data type specified to the local representation of the data. The last bit read from in the buffer is returned as last_bit_used. The data is extracted according to the start bit, length, number of samples, sample offset, etc.

Parameters
[in]input_ptrThe buffer to extract the parameter from.
[in]input_lengthThe valid number of bits that can be read from this buffer.
[out]last_bit_usedSet to the last bit read from if SUCCESS is returned.
Returns
SUCCESS
TREK_DATA_NO_PARENT
TREK_DATA_EXT_NUM_SAMP_EXTRACT_FAIL
TREK_DATA_EXT_NUM_SAMP_PARAM_NOT_FOUND
TREK_DATA_EXT_STATUS_PARAM_NOT_FOUND
TREK_DATA_EXT_NUM_SAMP_BAD_VALUE
TREK_DATA_EXT_NUM_SAMP_VALUE_FAIL
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_INVALID_BYTE_ORDER
TREK_DATA_INVALID_DATA_TYPE
TREK_LAST_BIT_ERROR
TREK_DATA_NULL_PTR

Example:

int32_t ret_value;
unsigned char buf[100];
uint32_t last_bit;
ret_value = p.Extract( buf, 100, last_bit );
if( ret_value )
{
// process error
}
else
{
// p.GetValue()...would return a value.
}
int32_t Extract(uint8_t *input_ptr, uint32_t input_length, uint32_t &last_bit_used)
Extracts the parameter from the specified buffer.
Definition: parameter.cpp:4583

◆ FindLastBit()

int32_t trek::Parameter::FindLastBit ( uint32_t &  last_bit)

Finds the last bit used when building the parameter.

Parameters
last_bitIf successful, set to the last bit used when building the parameter.
Returns
SUCCESS
TREK_DATA_FIXED_LENGTH_REQUIRED

Example:

uint32_t last_bit;
int32_t ret_value;
// assumes that the Parameter's data type, length, etc. has been set
ret_value = p.FindLastBit( last_bit );
if( ret_value )
printf("Must be variable length.\n");
else
printf("Last bit is %u.\n", last_bit );
int32_t FindLastBit(uint32_t &last_bit)
Finds the last bit used when building the parameter.
Definition: parameter.cpp:6099

◆ GetAutoClear()

bool trek::Parameter::GetAutoClear ( )

Gets the auto clear behavior of the parameter instance.

See SetAutoClear for details.

Returns
The current state for auto clear.

◆ GetByteOrder()

byte_order_type trek::Parameter::GetByteOrder ( )

Gets the byte order for the parameter.

Can call GetByteOrderAsString() to get the byte order in a printable format.

Returns
The byte order.

Example:

byte_order_type my_byte_order;
my_byte_order = p.GetByteOrder();
byte_order_type GetByteOrder()
Gets the byte order for the parameter.
Definition: parameter.cpp:3245
byte_order_type
Byte order enumeration.
Definition: trek.h:75

◆ GetByteOrderAsString()

const char * trek::Parameter::GetByteOrderAsString ( )

Returns the byte order for the parameter as a string.

Example:

printf( "The default byte order is %s\n", p.GetByteOrderAsString() );
const char * GetByteOrderAsString()
Returns the byte order for the parameter as a string.
Definition: parameter.cpp:3348

◆ GetCalibrateBeforeAlarmCheck()

bool trek::Parameter::GetCalibrateBeforeAlarmCheck ( )

Identifies if the parameter value is calibrated prior to alarm checking the value.

Returns true is the parameter is calibrated prior to checking alarms. Otherwise, returns false.

Example:

printf("Parameter is will be calibrated prior to alarm checks.\n");
bool GetCalibrateBeforeAlarmCheck()
Identifies if the parameter value is calibrated prior to alarm checking the value.
Definition: parameter.cpp:3714

◆ GetCalibratedValue() [1/2]

int32_t trek::Parameter::GetCalibratedValue ( double &  input,
uint16_t  sample_number = 1 
)

Gets the calibrated value of a parameter as a 64-bit floating point.

A calibrator must be defined for the parameter or TREK_DATA_CALIBRATOR_NOT_DEFINED is returned.

Parameters
[out]inputThe variable to be populated with the Parameter's calibrated value.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_CALIBRATOR_NOT_DEFINED
TREK_DATA_RANGE_ERROR
TREK_DATA_CALIBRATION_ERROR
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
double value;
ret_value = p.GetCalibratedValue( value ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}
int32_t GetCalibratedValue(double &output, uint16_t sample_number=1)
Gets the calibrated value of a parameter as a 64-bit floating point.
Definition: parameter.cpp:11290
Examples
integrate_user_calibrator/integrate_user_calibrator.cpp.

◆ GetCalibratedValue() [2/2]

int32_t trek::Parameter::GetCalibratedValue ( double &  input,
uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Gets the calibrated value of a parameter as a 64-bit floating point and its associated status.

A calibrator must be defined for the parameter or TREK_DATA_CALIBRATOR_NOT_DEFINED is returned. The trek_status and src_status can be used with ParameterStatus.

Parameters
[out]inputThe variable to be populated with the Parameter's calibrated value.
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_CALIBRATOR_NOT_DEFINED
TREK_DATA_RANGE_ERROR
TREK_DATA_CALIBRATION_ERROR
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
double value;
uint32_t trek_status, src_status;
ret_value = p.GetCalibratedValue( value, trek_status, src_status ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetCalibrator()

Calibrator * trek::Parameter::GetCalibrator ( )

Returns a copy of the calibrator.

Value will be NULL (0) if calibrator does not exist. The caller of this method is responsible for deleting the associated memory.

Returns
Pointer to the calibrator.

Example:

Calibrator *cal_ptr;
cal_ptr = p.GetCalibrator();
// when finished with the pointer...
delete cal_ptr;
This class is the abstraction for all numeric calibration.
Definition: calibrator.h:20
Calibrator * GetCalibrator()
Returns a copy of the calibrator.
Definition: parameter.cpp:5871

◆ GetCalibratorSwitchSet()

CalibratorSwitchSet * trek::Parameter::GetCalibratorSwitchSet ( )

Returns a copy of the calibrator switch set.

Value will be NULL (0) if calibrator switch set does not exist. The caller of this method is responsible for deleting the associated memory.

Returns
Pointer to the calibrator switch set.

Example:

set_ptr = p.GetCalibratorSwitchSet();
// when finished with the pointer...
delete set_ptr;
This class switches calibrator sets.
Definition: calibrator_switch_set.h:20
CalibratorSwitchSet * GetCalibratorSwitchSet()
Returns a copy of the calibrator switch set.
Definition: parameter.cpp:5895

◆ GetContinueOnRangeError()

bool trek::Parameter::GetContinueOnRangeError ( )

Identifies if parameter processing will continue on a range error.

Returns true if processing will continue on detection of a range error. Otherwise, returns false.

Example:

printf("Range error will not stop processing of parameter.\n");
bool GetContinueOnRangeError()
Identifies if parameter processing will continue on a range error.
Definition: parameter.cpp:3730

◆ GetDataFormatAsString()

const char * trek::Parameter::GetDataFormatAsString ( )

Returns the data format for the parameter as a string.

Example:

printf( "The default data format is %s\n", p.GetDataFormatAsString() );
const char * GetDataFormatAsString()
Returns the data format for the parameter as a string.
Definition: parameter.cpp:3362

◆ GetDataType()

parameter_data_type trek::Parameter::GetDataType ( )

Gets the data type for the parameter.

You can get the value as a string by calling GetDataTypeAsString().

Returns
The data type enumeration.

Example:

parameter_data_type my_data_type;
my_data_type = p.GetDataType();
parameter_data_type GetDataType()
Gets the data type for the parameter.
Definition: parameter.cpp:3182
parameter_data_type
Enumeration of all valid data types for TReK.
Definition: parameter.h:40

◆ GetDataTypeAsString()

const char * trek::Parameter::GetDataTypeAsString ( )

Returns the data type for the parameter as a string.

Example:

printf( "The default data type is %s\n", p.GetDataTypeAsString() );
const char * GetDataTypeAsString()
Returns the data type for the parameter as a string.
Definition: parameter.cpp:3334

◆ GetDependency()

Dependency * trek::Parameter::GetDependency ( uint32_t  num)

Gets the specified dependency for a parameter.

Dependency numbers are zero based. This method will return a NULL value if the dependency does not exist. The caller of this method is responsible for deleting the pointer when it is no longer needed.

Example:

Dependency *dep_ptr;
// assuming dependencies were added
for( uint32_t ii = 0; ii < p.GetNumberOfDependencies(); ii++ )
{
dep_ptr = p.GetDependency( ii );
if( dep_ptr )
{
// do something
}
}
This class is the abstraction for all parameter dependencies.
Definition: dependency.h:21
Dependency * GetDependency(uint32_t num)
Gets the specified dependency for a parameter.
Definition: parameter.cpp:1988
uint32_t GetNumberOfDependencies()
Gets the number of dependencies for a parameter.
Definition: parameter.cpp:1955

◆ GetDoubleHighRange()

double trek::Parameter::GetDoubleHighRange ( )

Returns the high range value of a data type that is stored as a double (ST_DOUBLE).

You should check UseHighRange to see if the value is being used.

Example:

double high_range;
if( p.UseHighRange() )
high_range = p.GetDoubleHighRange();
bool UseHighRange()
Identifies if a high range value is currently in use.
Definition: parameter.cpp:3452
double GetDoubleHighRange()
Returns the high range value of a data type that is stored as a double (ST_DOUBLE).
Definition: parameter.cpp:3554

◆ GetDoubleLowRange()

double trek::Parameter::GetDoubleLowRange ( )

Returns the low range value of a data type that is stored as a double (ST_DOUBLE).

You should check UseLowRange to see if the value is being used.

Example:

double low_range;
if( p.UseLowRange() )
low_range = p.GetDoubleLowRange();
bool UseLowRange()
Identifies if a low range value is currently in use.
Definition: parameter.cpp:3436
double GetDoubleLowRange()
Returns the low range value of a data type that is stored as a double (ST_DOUBLE).
Definition: parameter.cpp:3537

◆ GetEngineeringUnits()

const char * trek::Parameter::GetEngineeringUnits ( )

Gets the engineering units of the parameter.

Returns
The engineering units.

Example:

printf( "EngUnits...%s\n", p.GetEngineeringUnits() );
const char * GetEngineeringUnits()
Gets the engineering units of the parameter.
Definition: parameter.cpp:3212

◆ GetEnumeratedValue() [1/2]

int32_t trek::Parameter::GetEnumeratedValue ( char *  output_str,
uint32_t *  size_of_output,
uint16_t  sample_number = 1 
)

Get the enumerated value for a parameter.

Parameters
[out]output_strThe enumerated value if SUCCESS is returned
[in,out]size_of_outputThe size of the output buffer. If return code is TREK_DATA_NOT_ENOUGH_SPACE, then this value is reset to the number of bytes required for the given enumerated value.
[in]sample_numberOptional parameter to set the specified sample number. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_ENUMERATOR_NOT_DEFINED
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_ENUMERATION_DOES_NOT_EXIST
TREK_DATA_NOT_ENOUGH_SPACE
TREK_DATA_NULL_PTR

Example:

int32_t ret_value;
char output[100];
uint32_t size_of_output;
size_of_output = 100; // always set
ret_value = p.GetEnumeratedValue( output, &size_of_output ); // get first sample
if( ret_value )
{
// process errors
if( ret_value == TREK_DATA_NOT_ENOUGH_SPACE )
printf("Need to increase size of character buffer\n");
}
else
printf( "Enumerated Value: %s\n", output );
int32_t GetEnumeratedValue(char *output_str, uint32_t *size_of_output, uint16_t sample_number=1)
Get the enumerated value for a parameter.
Definition: parameter.cpp:11154
#define TREK_DATA_NOT_ENOUGH_SPACE
The specified data buffer is not larger enough to hold the data.
Definition: trek_data_error_codes.h:43

◆ GetEnumeratedValue() [2/2]

int32_t trek::Parameter::GetEnumeratedValue ( char *  output_str,
uint32_t *  size_of_output,
uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Gets the enumerated value of a parameter and its associated status.

The trek_status and src_status can be used with ParameterStatus.

Parameters
[out]output_strThe enumerated value if SUCCESS is returned
[in,out]size_of_outputThe size of the output buffer. If return code is TREK_DATA_NOT_ENOUGH_SPACE, then this value is reset to the number of bytes required for the given enumerated value.
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_ENUMERATOR_NOT_DEFINED
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_ENUMERATION_DOES_NOT_EXIST
TREK_DATA_NOT_ENOUGH_SPACE
TREK_DATA_NULL_PTR

Example:

int32_t ret_value;
int8_t value;
uint32_t trek_status, src_status;
ret_value = p.GetValue( value, trek_status, src_status ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}
int32_t GetValue(int8_t &input, uint16_t sample_number=1)
Gets the value of a parameter as an 8-bit signed integer.
Definition: parameter.cpp:8546

◆ GetEnumerator()

BaseEnumerator * trek::Parameter::GetEnumerator ( )

Returns a copy of the enumerator.

Value will be NULL (0) if enumerator does not exist. The caller of this method is responsible for deleting the associated memory. You can call the Enumerator::GetElementName() method to determine the type of enumerator as needed.

Returns
Pointer to the enumerator.

Example:

Enumerator *e_ptr;
e_ptr = p.GetEnumerator();
// when finished with the pointer...
delete e_ptr;
This class maps unsigned integer values to strings for enumeration.
Definition: enumerator.h:21
BaseEnumerator * GetEnumerator()
Returns a copy of the enumerator.
Definition: parameter.cpp:5823

◆ GetEnumeratorSwitchSet()

EnumeratorSwitchSet * trek::Parameter::GetEnumeratorSwitchSet ( )

Returns a copy of the enumerator switch set.

Value will be NULL (0) if enumerator switch set does not exist. The caller of this method is responsible for deleting the associated memory.

Returns
Pointer to the enumerator switch set.

Example:

set_ptr = p.GetEnumatorSwitchSet();
// when finished with the pointer...
delete set_ptr;
This class switches calibrator sets.
Definition: enumerator_switch_set.h:20

◆ GetExpectedStateAlarm()

ExpectedStateAlarm * trek::Parameter::GetExpectedStateAlarm ( )

Returns a copy of the expected state alarm.

Value will be NULL (0) if an expected state alarm does not exist. The caller of this method is responsible for deleting the associated memory.

Returns
Pointer to the limit alarm.

Example:

ExpectedStateAlarm *alarm_ptr;
alarm_ptr = p.GetExpectedStateAlarm();
// when finished with the pointer...
delete alarm_ptr;
This class checks expected state violations.
Definition: expected_state_alarm.h:21
ExpectedStateAlarm * GetExpectedStateAlarm()
Returns a copy of the expected state alarm.
Definition: parameter.cpp:5967

◆ GetExpectedStateAlarmSwitchSet()

ExpectedStateAlarmSwitchSet * trek::Parameter::GetExpectedStateAlarmSwitchSet ( )

Returns a copy of the expected state alarm switch set.

Value will be NULL (0) if expected state alarm switch set does not exist. The caller of this method is responsible for deleting the associated memory.

Returns
Pointer to the expected state alarm switch set.

Example:

// when finished with the pointer...
delete set_ptr;
This class switches expected state alarm sets.
Definition: expected_state_alarm_switch_set.h:20
ExpectedStateAlarmSwitchSet * GetExpectedStateAlarmSwitchSet()
Returns a copy of the expected state alarm switch set.
Definition: parameter.cpp:5991

◆ GetExternalNumSamplesParameter()

const char * trek::Parameter::GetExternalNumSamplesParameter ( )

Gets the name of the external number of samples parameter.

Will return an empty string if no parameter is defined.

Returns
The external number of samples parameter name.

◆ GetExternalStatusParameter()

const char * trek::Parameter::GetExternalStatusParameter ( )

Gets the name of the external status parameter.

Will return an empty string if no parameter is defined.

Returns
The external status parameter name.

◆ GetIntegerHighRange()

int64_t trek::Parameter::GetIntegerHighRange ( )

Returns the high range value of a data type that is stored as a signed integer (ST_SIGNED_64).

You should check UseHighRange to see if the value is being used.

Example:

int64_t high_range;
if( p.UseHighRange() )
high_range = p.GetIntegerHighRange();
int64_t GetIntegerHighRange()
Returns the high range value of a data type that is stored as a signed integer (ST_SIGNED_64).
Definition: parameter.cpp:3486

◆ GetIntegerLowRange()

int64_t trek::Parameter::GetIntegerLowRange ( )

Returns the low range value of a data type that is stored as a signed integer (ST_SIGNED_64).

You should check UseLowRange to see if the value is being used.

Example:

int64_t low_range;
if( p.UseLowRange() )
low_range = p.GetIntegerLowRange();
int64_t GetIntegerLowRange()
Returns the low range value of a data type that is stored as a signed integer (ST_SIGNED_64).
Definition: parameter.cpp:3469

◆ GetLength()

uint32_t trek::Parameter::GetLength ( )

Gets the length of the parameter.

Returns
The length in bits.

Example:

uint32_t len;
len = p.GetLength();
uint32_t GetLength()
Gets the length of the parameter.
Definition: parameter.cpp:3198

◆ GetLimitAlarmSwitchSet()

LimitAlarmSwitchSet * trek::Parameter::GetLimitAlarmSwitchSet ( )

Returns a copy of the limit alarm switch set.

Value will be NULL (0) if limit alarm switch set does not exist. The caller of this method is responsible for deleting the associated memory.

Returns
Pointer to the limit alarm switch set.

Example:

set_ptr = p.GetLimitAlarmSwitchSet();
// when finished with the pointer...
delete set_ptr;
This class switches limit sets.
Definition: limit_alarm_switch_set.h:35
LimitAlarmSwitchSet * GetLimitAlarmSwitchSet()
Returns a copy of the limit alarm switch set.
Definition: parameter.cpp:5943

◆ GetLimits()

LimitAlarm * trek::Parameter::GetLimits ( )

Returns a copy of the limit alarm.

Value will be NULL (0) if limit alarm does not exist. The caller of this method is responsible for deleting the associated memory.

Returns
Pointer to the limit alarm.

Example:

LimitAlarm *alarm_ptr;
alarm_ptr = p.GetLimits();
// when finished with the pointer...
delete alarm_ptr;
This class checks a value for violation of defined limits.
Definition: limit_alarm.h:37
LimitAlarm * GetLimits()
Returns a copy of the limit alarm.
Definition: parameter.cpp:5919

◆ GetNumberOfDependencies()

uint32_t trek::Parameter::GetNumberOfDependencies ( )

Gets the number of dependencies for a parameter.

Parameter will always appear in the packet when dependencies are removed.

Example:

int32_t ret_value;
// assuming dependencies were added
for( uint32_t ii = 0; ii < p.GetNumberOfDependencies(); ii++ )
{
ret_value = p.GetDependency( ii, dep );
if( ret_value == SUCCESS )
{
// do something
}
}
#define SUCCESS
The function completed successfully.
Definition: trek_error.h:8

◆ GetNumberOfSamples()

uint32_t trek::Parameter::GetNumberOfSamples ( )

Gets the number of samples for the parameter.

Returns
The number of samples.

Example:

uint32_t num_samples;
num_samples = p.GetNumberOfSamples();
uint32_t GetNumberOfSamples()
Gets the number of samples for the parameter.
Definition: parameter.cpp:3261
Examples
extract_packet/extract_packet.cpp.

◆ GetNumberOfSyllables()

uint32_t trek::Parameter::GetNumberOfSyllables ( )

Gets the number of syllables for the parameter.

Returns
The number of syllables.

Example:

uint32_t num_syllables;
num_syllables = p.GetNumberOfSyllables();
uint32_t GetNumberOfSyllables()
Gets the number of syllables for the parameter.
Definition: parameter.cpp:3294

◆ GetSampleOffset()

uint32_t trek::Parameter::GetSampleOffset ( )

Gets the sample offset for the parameter.

Only applicable for parameters with number of samples greater than 1.

Returns
The number of bits from the end of one sample to the beginning of the next sample.

Example:

uint32_t sample_offset;
sample_offset = p.GetSampleOffset();
uint32_t GetSampleOffset()
Gets the sample offset for the parameter.
Definition: parameter.cpp:3278

◆ GetStartBit()

uint32_t trek::Parameter::GetStartBit ( )

Gets the start bit of the parameter.

Returns
The start bit.

Example:

uint32_t start_bit;
start_bit = p.GetStartBit();
uint32_t GetStartBit()
Gets the start bit of the parameter.
Definition: parameter.cpp:3228

◆ GetSyllableInfo()

int32_t trek::Parameter::GetSyllableInfo ( uint32_t  syll_num,
uint32_t &  start_bit,
uint32_t &  length 
)

Gets the start bit and length for a syllable in a parameter.

Parameters
[in]syll_numThe syllable number to change for the parameter. Syllable numbers start at 1.
[in]start_bitThe start bit for the syllable.
[in]lengthThe length for the syllable.
Returns
SUCCESS
TREK_DATA_BAD_SYLLABLE_NUMBER

Example:

int32_t SetNumberOfSyllables(uint32_t input)
Sets the number of syllables for the parameter.
Definition: parameter.cpp:1809

◆ GetUnsignedHighRange()

uint64_t trek::Parameter::GetUnsignedHighRange ( )

Returns the high range value of a data type that is stored as an unsigned integer (ST_UNSIGNED_64).

You should check UseHighRange to see if the value is being used.

Example:

uint64_t high_range;
if( p.UseHighRange() )
high_range = p.GetUnsignedHighRange();
uint64_t GetUnsignedHighRange()
Returns the high range value of a data type that is stored as an unsigned integer (ST_UNSIGNED_64).
Definition: parameter.cpp:3520

◆ GetUnsignedLowRange()

uint64_t trek::Parameter::GetUnsignedLowRange ( )

Returns the low range value of a data type that is stored as an unsigned integer (ST_UNSIGNED_64).

You should check UseLowRange to see if the value is being used.

Example:

uint64_t low_range;
if( p.UseLowRange() )
low_range = p.GetUnsignedLowRange();
uint64_t GetUnsignedLowRange()
Returns the low range value of a data type that is stored as an unsigned integer (ST_UNSIGNED_64).
Definition: parameter.cpp:3503

◆ GetValue() [1/28]

int32_t trek::Parameter::GetValue ( bool &  input,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a boolean.

The Parameter's data type must be a boolean.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_INVALID_INPUT_FOR_TYPE

Example:

int32_t ret_value;
bool value;
ret_value = p.GetValue( value ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [2/28]

int32_t trek::Parameter::GetValue ( bool &  input,
uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a boolean and its associated status.

The trek_status and src_status can be used with ParameterStatus.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
bool value;
uint32_t trek_status, src_status;
ret_value = p.GetValue( value, trek_status, src_status ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [3/28]

int32_t trek::Parameter::GetValue ( char *  input_ptr,
uint32_t  length,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a char array.

The Parameter's data type must be either DT_NULL_TERMINATED_STRING or DT_FIXED_LENGTH_STRING.

Parameters
[out]input_ptrThe variable to be populated with the Parameter's value.
[in]lengthThe number of bytes available in input.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_NULL_PTR

Example:

int32_t ret_value;
char value[100];
ret_value = p.GetValue( value, 100 ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [4/28]

int32_t trek::Parameter::GetValue ( char *  input_ptr,
uint32_t  length,
uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a char array.

The Parameter's data type must be either DT_NULL_TERMINATED_STRING or DT_FIXED_LENGTH_STRING.

Parameters
[out]input_ptrThe variable to be populated with the Parameter's value.
[in]lengthThe number of bytes available in input.
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_NULL_PTR

Example:

int32_t ret_value;
char value[100];
uint32_t trek_status, src_status;
ret_value = p.GetValue( value, 100, trek_status, src_status ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [5/28]

int32_t trek::Parameter::GetValue ( double &  input,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a 64-bit floating point.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
double value;
ret_value = p.GetValue( value ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [6/28]

int32_t trek::Parameter::GetValue ( double &  input,
uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a 64-bit floating point and its associated status.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
double value;
uint32_t trek_status, src_status;
ret_value = p.GetValue( value, trek_status, src_status ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [7/28]

int32_t trek::Parameter::GetValue ( float &  input,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a 32-bit floating point.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
float value;
ret_value = p.GetValue( value ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [8/28]

int32_t trek::Parameter::GetValue ( float &  input,
uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a 32-bit floating point and its associated status.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
float value;
uint32_t trek_status, src_status;
ret_value = p.GetValue( value, trek_status, src_status ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [9/28]

int32_t trek::Parameter::GetValue ( int16_t &  input,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a 16-bit signed integer.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
int16_t value;
ret_value = p.GetValue( value ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [10/28]

int32_t trek::Parameter::GetValue ( int16_t &  input,
uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a 16-bit signed integer and its associated status.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
int16_t value;
uint32_t trek_status, src_status;
ret_value = p.GetValue( value, trek_status, src_status ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [11/28]

int32_t trek::Parameter::GetValue ( int32_t &  input,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a 32-bit signed integer.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
int32_t value;
ret_value = p.GetValue( value ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [12/28]

int32_t trek::Parameter::GetValue ( int32_t &  input,
uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a 32-bit signed integer and its associated status.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
int32_t value;
uint32_t trek_status, src_status;
ret_value = p.GetValue( value, trek_status, src_status ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [13/28]

int32_t trek::Parameter::GetValue ( int64_t &  input,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a 64-bit signed integer.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
int64_t value;
ret_value = p.GetValue( value ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [14/28]

int32_t trek::Parameter::GetValue ( int64_t &  input,
uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a 64-bit signed integer and its associated status.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
int64_t value;
uint32_t trek_status, src_status;
ret_value = p.GetValue( value, trek_status, src_status ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [15/28]

int32_t trek::Parameter::GetValue ( int8_t &  input,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as an 8-bit signed integer.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
int8_t value;
ret_value = p.GetValue( value ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}
Examples
tlm_api_cpp_newest/cpp_newest_main.cpp.

◆ GetValue() [16/28]

int32_t trek::Parameter::GetValue ( int8_t &  input,
uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as an 8-bit signed integer and its associated status.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
int8_t value;
uint32_t trek_status, src_status;
ret_value = p.GetValue( value, trek_status, src_status ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [17/28]

int32_t trek::Parameter::GetValue ( TrekTime input,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a TrekTime.

The Parameter's data type must be a time type.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_INVALID_INPUT_FOR_TYPE

Example:

int32_t ret_value;
TrekTime value;
ret_value = p.GetValue( value ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}
This class holds a time value represented as seconds from the system epoch.
Definition: trek_time.h:25

◆ GetValue() [18/28]

int32_t trek::Parameter::GetValue ( TrekTime input,
uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a TrekTime.

The Parameter's data type must be a time type.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_INVALID_INPUT_FOR_TYPE

Example:

int32_t ret_value;
TrekTime value;
ret_value = p.GetValue( value ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [19/28]

int32_t trek::Parameter::GetValue ( uint16_t &  input,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a 16-bit unsigned integer.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
uint16_t value;
ret_value = p.GetValue( value ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [20/28]

int32_t trek::Parameter::GetValue ( uint16_t &  input,
uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a 16-bit unsigned integer and its associated status.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
uint16_t value;
uint32_t trek_status, src_status;
ret_value = p.GetValue( value, trek_status, src_status ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [21/28]

int32_t trek::Parameter::GetValue ( uint32_t &  input,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a 32-bit unsigned integer.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
uint32_t value;
ret_value = p.GetValue( value ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [22/28]

int32_t trek::Parameter::GetValue ( uint32_t &  input,
uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a 32-bit unsigned integer and its associated status.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
uint32_t value;
uint32_t trek_status, src_status;
ret_value = p.GetValue( value, trek_status, src_status ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [23/28]

int32_t trek::Parameter::GetValue ( uint64_t &  input,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a 64-bit unsigned integer.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
uint64_t value;
ret_value = p.GetValue( value ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [24/28]

int32_t trek::Parameter::GetValue ( uint64_t &  input,
uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as a 64-bit unsigned integer and its associated status.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
uint64_t value;
uint32_t trek_status, src_status;
ret_value = p.GetValue( value, trek_status, src_status ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [25/28]

int32_t trek::Parameter::GetValue ( uint8_t &  input,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as an 8-bit unsigned integer.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
uint8_t value;
ret_value = p.GetValue( value ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [26/28]

int32_t trek::Parameter::GetValue ( uint8_t &  input,
uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Gets the value of a parameter as an 8-bit unsigned integer and its associated status.

If data loss may have occurred, a value of TREK_DATA_POSSIBLE_LOSS_OF_DATA is returned. Data loss can indicate that the Parameter's value is too large or too small for this data type. The trek_status and src_status can be used with ParameterStatus.

Parameters
[out]inputThe variable to be populated with the Parameter's value.
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
uint8_t value;
uint32_t trek_status, src_status;
ret_value = p.GetValue( value, trek_status, src_status ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [27/28]

int32_t trek::Parameter::GetValue ( uint8_t *  input_ptr,
uint32_t *  num_bits_ptr,
uint16_t  sample_number = 1 
)

Gets the "raw" value of a parameter.

For Parameters with a data type of DT_UNSPECIFIED_BYTES this is the only way to get its value.

Note
The length parameter is in bits, not bytes.
Parameters
[out]input_ptrThe variable to be populated with the Parameter's value. For non-byte boundary data, the data is right justified.
[in,out]num_bits_ptrThe number of bits available in input. Also the number of bits of valid data on the output.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_DATA_WILL_NOT_FIT
TREK_DATA_NULL_PTR

Example:

int32_t ret_value;
uint8_t value[100];
uint32_t length;
length = 800; // 100 bits * 8 bits/byte
ret_value = p.GetValue( value, &length ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValue() [28/28]

int32_t trek::Parameter::GetValue ( uint8_t *  input_ptr,
uint32_t *  num_bits_ptr,
uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Gets the "raw" value of a parameter and its associated status.

For Parameters with a data type of DT_UNSPECIFIED_BYTES this is the only way to get its value. The trek_status and src_status can be used with ParameterStatus.

Note
The length parameter is in bits, not bytes.
Parameters
[out]input_ptrThe variable to be populated with the Parameter's value. For non-byte boundary data, the data is right justified.
[in,out]num_bits_ptrThe number of bits available in input. Also the number of bits of valid data on the output.
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE

Example:

int32_t ret_value;
uint8_t value[100];
uint32_t length;
uint32_t trek_status, src_status;
lenght = 800; // 100 bits * 8 bits/byte
ret_value = p.GetValue( value, &length, trek_status, src_status ); // get the first sample
if( ret_value )
{
// process errors
}
else
{
// value was updated
}

◆ GetValueAsString() [1/2]

const char * trek::Parameter::GetValueAsString ( uint16_t  sample_number = 1)

Returns the value of the parameter as a string.

The format of the string is based on the data type and the value set for data format (SetDataFormat). If the parameter has no value, an empty string is returned. If the sample is not found, "?" is returned...sans quotes. If a parameter is invalid, the string "!" is returned.

Parameters
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).
Note
The string representation of floating point numbers may not represent the full precision of a given value.

Example:

printf("Value is '%s'\n", p.GetValueAsString() );
const char * GetValueAsString(uint16_t sample_number=1)
Returns the value of the parameter as a string.
Definition: parameter.cpp:11511
Examples
cmd_api_cpp/cmd_api_cpp_main.cpp, and extract_packet/extract_packet.cpp.

◆ GetValueAsString() [2/2]

const char * trek::Parameter::GetValueAsString ( uint32_t &  trek_status,
uint32_t &  src_status,
uint16_t  sample_number = 1 
)

Returns the value of the parameter as a string and its associated status.

The format of the string is based on the data type and the value set for data format (SetDataFormat). If the parameter has no value, an empty string is returned. If the sample is not found, "?" is returned...sans quotes. If a parameter is invalid, the string "!" is returned. The trek_status and src_status can be used with ParameterStatus.

Parameters
[out]trek_statusThe status associated with TReK processing.
[out]src_statusThe status associated with processing at the source of the data. In most cases this will not be applicable and the value will be 0.
[in]sample_numberOptional parameter to specify the sample number from which a value is desired. Default value is 1 (first sample).

Example:

uint32_t trek_status, src_status;
printf("Value is '%s'\n", p.GetValueAsString( trek_status, src_status ) );
printf("TReK status is %08x\n", trek_status );
printf("Source status is %08x\n", src_status );

◆ HasCalibrator()

bool trek::Parameter::HasCalibrator ( )

Identifies if the parameter currently has calibration defined.

Returns true is the parameter has calibration. Otherwise, returns false.

Example:

if( p.HasCalibrator() )
printf("Parameter has calibration\n");
bool HasCalibrator()
Identifies if the parameter currently has calibration defined.
Definition: parameter.cpp:3681

◆ HasEnumerator()

bool trek::Parameter::HasEnumerator ( )

Identifies if the parameter currently has an enumerator defined.

Returns true is the parameter has an enumerator. Otherwise, returns false.

Example:

if( p.HasEnumerator() )
printf("Parameter has an enumerator\n");
bool HasEnumerator()
Identifies if the parameter currently has an enumerator defined.
Definition: parameter.cpp:3662

◆ HasExpectedState()

bool trek::Parameter::HasExpectedState ( )

Identifies if the parameter currently has an expected state defined.

Returns true is the parameter has an expected state. Otherwise, returns false.

Example:

printf("Parameter has an expected state\n");
bool HasExpectedState()
Identifies if the parameter currently has an expected state defined.
Definition: parameter.cpp:3643

◆ HasLimits()

bool trek::Parameter::HasLimits ( )

Identifies if the parameter currently has limits defined.

Returns true is the parameter has limits. Otherwise, returns false.

Example:

if( p.HasLimits() )
printf("Parameter has limits\n");
bool HasLimits()
Identifies if the parameter currently has limits defined.
Definition: parameter.cpp:3624

◆ HasValue()

bool trek::Parameter::HasValue ( )

Identifies if the parameter currently has a value.

Returns true is the parameter has a value. Otherwise, returns false.

Example:

if( p.HasValue() )
printf("Parameter has a value\n");
bool HasValue()
Identifies if the parameter currently has a value.
Definition: parameter.cpp:3607

◆ Init()

void trek::Parameter::Init ( )
virtual

Initializes the object.

This method can be called to reinitialize a parameter to its default configuration. It is useful if you want to reuse the same object as shown in the example below.

Example:

// not checking return codes, but you should
p.SetName( "First" );
p.SetAlias( "AliasForFirst" );
p.SetShortDescription( "Some words." );
p.SetLongDescription( "Lots of words. Ok, maybe not that many." );
pc.AddParameter( p );
p.Init();
p.SetName( "Second" );
pc.AddParameter( p ); // alias, short description, and long descriptions are blank.
void SetLongDescription(const char *input_ptr)
Sets the long description of the item.
Definition: named_item.cpp:153
void SetName(const char *input_ptr)
Sets the name of the item.
Definition: named_item.cpp:114
void SetAlias(const char *input)
Sets the alias of the item.
Definition: named_item.cpp:127
void SetShortDescription(const char *input_ptr)
Sets the short description of the item.
Definition: named_item.cpp:140
This class describes a parameter collection composed of one or more parameters.
Definition: parameter_collection.h:24
int32_t AddParameter(Parameter *input_ptr)
Adds the parameter to the collection.
Definition: parameter_collection.cpp:291
void Init()
Initializes the object.
Definition: parameter.cpp:412
@ DT_UNSIGNED_INTEGER
Unsigned integer value ranging from 1 to 64 bits in length.
Definition: parameter.h:42
@ DT_TWOS_COMPLEMENT
Two's complement integer value ranging from 2 to 64 bits in length.
Definition: parameter.h:41

Reimplemented from trek::NamedItem.

Examples
define_packet/define_packet.cpp.

◆ IsModifiable()

bool trek::Parameter::IsModifiable ( )

Identifies if the parameter can be modified.

Returns true is the parameter can be modified. Otherwise, returns false.

Note
A parameter that is not modifiable can still be set if there is no current value.

Example:

if( p.IsModifiable() )
printf("Parameter is modifiable\n");
bool IsModifiable()
Identifies if the parameter can be modified.
Definition: parameter.cpp:3590

◆ IsValid()

bool trek::Parameter::IsValid ( )

Checks to see if a parameter is valid.

Returns
true Parameter is valid
false Parameter is invalid

Example:

const char *msg;
p.SetDataFormat( DF_DATA_TIME ); // would normally fail as default data type is unsigned integer
if( p.IsValid() )
printf( "This shouldn't occur since Validate must be called to check.\n" );
if( p.Validate( &msg ) )
printf( "Parameter is ok\n" );
else
{
// invalid data print the errors
printf( "%s\n", msg );
}
// now this function might succeed
if( p.IsValid() )
printf( "Parameter is valid.\n" );

◆ IsVariableLength()

bool trek::Parameter::IsVariableLength ( )

Identifies if the parameter can have a variable length.

Returns true is the parameter has a variable length. Otherwise, returns false.

Example:

printf("Parameter has a variable length\n");
bool IsVariableLength()
Identifies if the parameter can have a variable length.
Definition: parameter.cpp:3571

◆ LoadFile()

int32_t trek::Parameter::LoadFile ( const char *  filename)

Loads the Parameter definition from the specified file.

Reads an XML format for the Parameter. It can be written in with SaveFile.

Parameters
[in]filenameThe file to load the parameter object from.
Returns
SUCCESS
TREK_DATA_NULL_PTR
Other return codes

Example:

ret_value = p.LoadFile( "my_file.xml" );
int32_t LoadFile(const char *filename)
Loads the Parameter definition from the specified file.
Definition: parameter.cpp:12300

◆ SaveFile()

int32_t trek::Parameter::SaveFile ( const char *  filename)

Saves the Parameter definition to the specified file.

Writes an XML format for the Parameter. It can be read in with LoadFile.

Parameters
[in]filenameThe file to save the parameter object to.
Returns
SUCCESS
TREK_DATA_NULL_PTR
Other return codes

Example:

ret_value = p.SaveFile( "my_file.xml" );
int32_t SaveFile(const char *filename)
Saves the Parameter definition to the specified file.
Definition: parameter.cpp:12335

◆ SetAutoClear()

void trek::Parameter::SetAutoClear ( bool  input)

Sets the auto clear behavior of the parameter instance.

By default a parameter value is cleared prior to extracting new values so that the parameter will not have a value if extraction fails (e.g., the parameter does not exist in that packet instance). This behavior can be turned off by passing in false to this method. When turned off the parameter will contain the previous value if extraction fails.

Parameters
[in]inputNew value for auto clear.

◆ SetCalibrateBeforeAlarmCheck()

void trek::Parameter::SetCalibrateBeforeAlarmCheck ( bool  input = true)

Sets a flag to indicate if alarm checks are performed prior to or after calibration.

True indicates that the parameter is calibrated prior to checking for alarm violations if calibration is available. If false, alarm violations are checked on the non-calibrated value. The default value is true.

Parameters
[in]inputThe new calibrate before sensing option for the parameter.

Example:

void SetCalibrateBeforeAlarmCheck(bool input=true)
Sets a flag to indicate if alarm checks are performed prior to or after calibration.
Definition: parameter.cpp:3140

◆ SetCalibratorSwitchSet() [1/2]

void trek::Parameter::SetCalibratorSwitchSet ( CalibratorSwitchSet input)

Sets the calibrator switch set to be used for this parameter.

The calibrator switch set can contain any of the supplied TReK calibrators such as PolynomialCalibrator. The Parameter class makes a copy of the calibrator. If a calibrator or calibrator switch set already exists, it will be replaced.

Parameters
[in]inputThe new calibrator switch set.
Note
Calibration uses a double precision floating point number in all calculations. Values that cannot be represented as a double precision floating point number may yield invalid results.

Example:

pc.SetName( "poly" );
pc.SetOrder( 2 );
pc.SetCoefficient( 0, -1 );
pc.SetCoefficient( 2, 1 ); // x^2 - 1
sc.SetName( "spline" );
sc.AddPoint( 0, 0 );
sc.AddPoint( 10, 100 );
sc.AddPoint( 255, 1000 );
cal_set.AddCalibrator( pc );
cal_set.AddCalibrator( sc );
cal_set.SetDefaultSetName( pc.GetName() );
cal_set.SetSwitchParameterName( "another_parameter" );
cal_set.AddRangeSwitch( 0, 5, "poly" );
cal_set.AddRangeSwitch( 5, 255, "spline" );
int32_t AddCalibrator(Calibrator *input)
Adds a calibrator.
Definition: calibrator_switch_set.cpp:92
const char * GetName()
Returns the name of the item.
Definition: named_item.cpp:188
void SetCalibratorSwitchSet(CalibratorSwitchSet &input)
Sets the calibrator switch set to be used for this parameter.
Definition: parameter.cpp:2259
This class calibrates a value using a polynomial equation.
Definition: polynomial_calibrator.h:17
int32_t SetCoefficient(uint16_t power, double input_value)
Sets the coefficient value for the specified term.
Definition: polynomial_calibrator.cpp:211
int32_t SetOrder(uint16_t input_value, bool keep_coefficients=false)
Sets the order for the polynomial calibrator.
Definition: polynomial_calibrator.cpp:121
This class calibrates a value using a series of line segments.
Definition: spline_calibrator.h:16
int32_t AddPoint(double converted_value, double calibrated_value)
Adds a point to the calibrator.
Definition: spline_calibrator.cpp:109
int32_t AddRangeSwitch(double low, double high, const char *name)
Adds a range switch.
Definition: switch_set.cpp:641
int32_t SetSwitchParameterName(const char *name)
Sets the name of the parameter to use as a switch.
Definition: switch_set.cpp:529
int32_t SetDefaultSetName(const char *name)
Sets the default set name.
Definition: switch_set.cpp:477

◆ SetCalibratorSwitchSet() [2/2]

void trek::Parameter::SetCalibratorSwitchSet ( CalibratorSwitchSet input)

Sets the calibrator switch set to be used for this parameter.

The calibrator switch set can contain any of the supplied TReK calibrators such as PolynomialCalibrator. The Parameter class makes a copy of the calibrator. If a calibrator or calibrator switch set already exists, it will be replaced.

Parameters
[in]inputThe new calibrator switch set.
Note
Calibration uses a double precision floating point number in all calculations. Values that cannot be represented as a double precision floating point number may yield invalid results.

Example:

pc.SetName( "poly" );
pc.SetOrder( 2 );
pc.SetCoefficient( 0, -1 );
pc.SetCoefficient( 2, 1 ); // x^2 - 1
sc.SetName( "spline" );
sc.AddPoint( 0, 0 );
sc.AddPoint( 10, 100 );
sc.AddPoint( 255, 1000 );
cal_set.AddCalibrator( pc );
cal_set.AddCalibrator( sc );
cal_set.SetDefaultSetName( pc.GetName() );
cal_set.SetSwitchParameterName( "another_parameter" );
cal_set.AddRangeSwitch( 0, 5, "poly" );
cal_set.AddRangeSwitch( 5, 255, "spline" );
p.SetCalibratorSwitchSet( &cal_set );

◆ SetContinueOnRangeError()

void trek::Parameter::SetContinueOnRangeError ( bool  input = false)

Sets a flag to indicate if processing can continue if a range error is detected.

True indicates that a range error will not stop processing of the data (including calibration). False will stop processing of the parameter when a range error is detected The default value is false.

Parameters
[in]inputThe new continue on range error option for the parameter.

Example:

void SetContinueOnRangeError(bool input=false)
Sets a flag to indicate if processing can continue if a range error is detected.
Definition: parameter.cpp:3158

◆ SetDataFormat()

int32_t trek::Parameter::SetDataFormat ( parameter_data_format  input)

Sets the data format for the printing the parameter to a string.

Will create the format for GetValueAsString. Currently ignored.

Parameters
[in]inputThe new data format.
Returns
SUCCESS
TREK_DATA_INVALID_DATA_TYPE
Note
Each data type can only have one data format representation at this time. The data format controls how the data is printed to a string either via a GetValueAsString call or to an XML file. Additional data formats will be allowed for some data types in a later release.

Example:

p.SetName( "MyInteger" );
p.SetDataType( DT_UNSIGNED_INTEGER, 32 ); // assume success returned
p.SetDataFormat( DF_HEX ); // will print data as hex instead of the default of decimal.
@ DF_HEX
All characters must be 0-9, a-f, or A-F.
Definition: parameter.h:68

◆ SetDataType()

int32_t trek::Parameter::SetDataType ( parameter_data_type  input_type,
uint32_t  input_len,
byte_order_type  input_order = BIG_ENDIAN_BYTE_ORDER,
bool  var_len = false 
)

Sets the data type, length, and byte order for the parameter.

The allowed length for each data type is shown in the table below. A byte order of LITTLE_ENDIAN_BYTE_ORDER is only allowed for certain data types when they are on byte boundaries. The number of samples will be reset to 1. Only a single variable length parameter is supported in a Packet. Multiple variable length parameters within a Packet will cause the Packet::Validate() method to fail.

Parameters
[in]input_typeThe data type for the parameter
[in]input_lenThe length of the parameter in bits
[in]input_orderThe byte order of the data type
[in]var_lenBoolean indicating if the data can be variable length
Data Type Description Valid Length (bits) Byte Order Allowed

Variable Length

DT_TWOS_COMPLEMENT Two's complement signed integer 2-64 BIG_ENDIAN_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER BYTE_SWAPPED_BYTE_ORDER WORD_SWAPPED_BYTE_ORDER

No

DT_UNSIGNED_INTEGER Unsigned integer 1-64 BIG_ENDIAN_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER BYTE_SWAPPED_BYTE_ORDER WORD_SWAPPED_BYTE_ORDER

No

DT_BINARY_CODED_DECIMAL Binary coded decimal 4, 8, 12, 16 BIG_ENDIAN_BYTE_ORDER

No

DT_DISTENDED_SIGNED_INTEGER Distended signed integer 16 or 32 BIG_ENDIAN_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER BYTE_SWAPPED_BYTE_ORDER WORD_SWAPPED_BYTE_ORDER

No

DT_SIGN_AND_MAGNITUDE_INTEGER Sign and magnitude integer 2-32 BIG_ENDIAN_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER BYTE_SWAPPED_BYTE_ORDER WORD_SWAPPED_BYTE_ORDER

No

DT_IEEE_FLOATING_POINT Single or double precision IEEE floating point 32 or 64 BIG_ENDIAN_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER

No

DT_NULL_TERMINATED_STRING ASCII string terminated by a NULL (0x00) character 16-524,288* BIG_ENDIAN_BYTE_ORDER BYTE_SWAPPED_BYTE_ORDER

Yes

DT_FIXED_LENGTH_STRING ASCII string of fixed length that may or may not contain a terminating character 8-524,288* BIG_ENDIAN_BYTE_ORDER BYTE_SWAPPED_BYTE_ORDER

No

DT_BOOLEAN Single bit value where 1 indicates true and 0 indicates false 1 BIG_ENDIAN_BYTE_ORDER

No

DT_UNSPECIFIED_BYTES Binary data that has no type 8-524,288* BIG_ENDIAN_BYTE_ORDER

Yes

DT_GPS_EPOCH_TIME Number of seconds since 1980-01-06 32 BIG_ENDIAN_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER

No

DT_EHS_TIME Time found in the EHS Primary Protocol Header. 52 and 56 bit versions have resolution to one tenth of a second. Flag fields are not processed. 48, 52, 56 BIG_ENDIAN_BYTE_ORDER

No

DT_ISS_TIME 40 bits (32-bit seconds since GPS plus 8 bit fractional time...1 bit = ~4ms) 40 BIG_ENDIAN_BYTE_ORDER

No

DT_FASTSAT_TIME 32-bit seconds since GPS with 16-bit millisec (max value 999) 48 BIG_ENDIAN_BYTE_ORDER

No

DT_DEM_TIME 32-bit seconds since GPS with 10-bit millisec (max value 999) 42 BIG_ENDIAN_BYTE_ORDER

No

DT_UNIX_TIME Number of seconds since 1970-01-01 32 BIG_ENDIAN_BYTE_ORDER LITTLE_ENDIAN_BYTE_ORDER

No

DT_EHS_CONV_TIME Special time conversion provided by EHS GSE time data. 320 BIG_ENDIAN_BYTE_ORDER

No

DT_ISAT_TIME 32-bit seconds since 1970-01-01 with 16-bit millisec (max value 999). 48 BIG_ENDIAN_BYTE_ORDER No

Length must be on a byte boundary.

Note
For time data types the last time that can be represented is different on each supported operating system. For Windows the last time that can be represented is 2106-02-07 06:28:15. For Linux the last time that can be represented is 2038-01-19 03:14:07. Any times that would convert past the last time will have a conversion error.
Returns
SUCCESS
TREK_DATA_FIXED_LENGTH_REQUIRED
TREK_DATA_INVALID_BYTE_ORDER
TREK_DATA_INVALID_LENGTH_FOR_DATA_TYPE
TREK_DATA_VAR_LEN_NUM_SAMPLE_ERROR

Example:

// just a bunch of nonsensical examples...
p.SetDataType( DT_UNSIGNED_INTEGER, 32, LITTLE_ENDIAN_BYTE_ORDER ); // little endian byte order
p.SetDataType( DT_TWOS_COMPLEMENT, 5 ); // 5-bit signed integer
p.SetDataType( DT_NULL_TERMINATED_STRING, 8000, BIG_ENDIAN_BYTE_ORDER, true ); // variable length string
@ DT_NULL_TERMINATED_STRING
ASCII string terminated by a NULL (0x00) character.
Definition: parameter.h:47
@ BIG_ENDIAN_BYTE_ORDER
Also known as network byte order. Most significant byte is first.
Definition: trek.h:76
@ LITTLE_ENDIAN_BYTE_ORDER
Least significant byte is first.
Definition: trek.h:77
Examples
define_packet/define_packet.cpp, and integrate_user_calibrator/integrate_user_calibrator.cpp.

◆ SetDefaultCalibrator() [1/2]

void trek::Parameter::SetDefaultCalibrator ( Calibrator input)

Sets the calibrator to be used for this parameter.

The calibrator can be on of the supplied TReK calibrators such as PolynomialCalibrator or a user calibrator. The Parameter class makes a copy of the calibrator. If a calibrator or calibrator switch set already exists, it will be replaced.

Parameters
[in]inputThe new calibrator.
Note
Calibration uses a double precision floating point number in all calculations. Values that cannot be represented as a double precision floating point number may yield invalid results.

Example:

c.SetOrder( 2 );
c.SetCoefficient( 0, -1 );
c.SetCoefficient( 2, 1 ); // x^2 - 1
void SetDefaultCalibrator(Calibrator &input)
Sets the calibrator to be used for this parameter.
Definition: parameter.cpp:2176
Examples
integrate_user_calibrator/integrate_user_calibrator.cpp.

◆ SetDefaultCalibrator() [2/2]

void trek::Parameter::SetDefaultCalibrator ( Calibrator input)

Sets the calibrator to be used for this parameter.

The calibrator can be on of the supplied TReK calibrators such as PolynomialCalibrator or a user calibrator. The Parameter class makes a copy of the calibrator. If a calibrator or calibrator switch set already exists, it will be replaced.

Parameters
[in]inputThe new calibrator.
Note
Calibration uses a double precision floating point number in all calculations. Values that cannot be represented as a double precision floating point number may yield invalid results.

Example:

c.SetOrder( 2 );
c.SetCoefficient( 0, -1 );
c.SetCoefficient( 2, 1 ); // x^2 - 1

◆ SetDoubleHighRange()

int32_t trek::Parameter::SetDoubleHighRange ( double  input)

Sets the high range value for a parameter that is stored as a floating point (ST_DOUBLE).

The input value must be greater than the current low range value for the parameter if the low range is in use. If successful, the high range flag is automatically set to true to indicate that the high range will be used.

Parameters
[in]inputThe new high range value for the parameter.
Returns
SUCCESS
TREK_DATA_VALUE_RANGE_ERROR
TREK_DATA_INVALID_INPUT_FOR_DATA_TYPE

Example:

int32_t ret_value;
ret_value = p.SetDoubleHighRange( 4267 );
if( ret_value )
printf("Error %d.\n", ret_value );
else
printf("High range set\n" );
int32_t SetDoubleHighRange(double input)
Sets the high range value for a parameter that is stored as a floating point (ST_DOUBLE).
Definition: parameter.cpp:2817

◆ SetDoubleLowRange()

int32_t trek::Parameter::SetDoubleLowRange ( double  input)

Sets the low range value for a parameter that is stored as a floating point (ST_DOUBLE).

The input value must be less than the current high range value for the parameter if the high range is in use. If successful, the low range flag is automatically set to true to indicate that the low range will be used.

Parameters
[in]inputThe new low range value for the parameter.
Returns
SUCCESS
TREK_DATA_VALUE_RANGE_ERROR
TREK_DATA_INVALID_INPUT_FOR_DATA_TYPE

Example:

int32_t ret_value;
ret_value = p.SetDoubleLowRange( 15.0 );
if( ret_value )
printf("Error %d.\n", ret_value );
else
printf("Low range set\n" );
int32_t SetDoubleLowRange(double input)
Sets the low range value for a parameter that is stored as a floating point (ST_DOUBLE).
Definition: parameter.cpp:2770

◆ SetEngineeringUnits()

void trek::Parameter::SetEngineeringUnits ( const char *  input)

Sets the engineering units for the parameter.

Although there is no predefined maximum length for the engineering units, it may be truncated to fit in a selected schema. The engineering units are for reference/display only and do not affect the parameter's value.

Parameters
[in]inputThe new engineering units for the parameter.

Example:

void SetEngineeringUnits(const char *input_ptr)
Sets the engineering units for the parameter.
Definition: parameter.cpp:1706

◆ SetEnumerator()

void trek::Parameter::SetEnumerator ( Enumerator input)

Sets the enumerator to be used for this parameter.

If the data type cannot be retrieved with a 32-bit unsigned integer, calls to GetEnumeratedValue will fail.

Parameters
[in]inputThe new enumerator. If a enumerator already exists, it will be replaced.

Example:

e.Add( 0, "Off" );
e.Add( 1, "On" );
int32_t Add(uint32_t int_value, const char *str_value_ptr, uint32_t end_value=0)
Adds the string values as enumeration for the unsigned integer value.
Definition: enumerator.cpp:159
void SetEnumerator(Enumerator &input)
Sets the enumerator to be used for this parameter.
Definition: parameter.cpp:2018

◆ SetEnumeratorSwitchSet() [1/2]

void trek::Parameter::SetEnumeratorSwitchSet ( EnumeratorSwitchSet input)

Sets the enumerator switch set to be used for this parameter.

The enumerator switched set can contain any of the supplied TReK enumerators such as RangeEnumerator. The Parameter class makes a copy of the enumerator switch set. If an enumerator or enumerator switched set already exists, it will be replaced.

Parameters
[in]inputThe new enumerator switch set.

Example:

e.SetName( "a" );
e.Add( 0, "zero" );
e.Add( 1, "one" );
e.Add( 2, "two" );
e.Add( 3, "three" );
re.SetName( "b" );
re.Add( 0, "zero or one", 1 );
re.Add( 2, "two or three", 3 );
enum_set.AddEnumerator( e );
enum_set.AddEnumerator( re );
enum_set.SetDefaultSetName( "a" );
enum_set.SetSwitchParameterName( "another_parameter" );
enum_set.AddRangeSwitch( 0, 5, "a" );
enum_set.AddRangeSwitch( 5, 255, "b" );
p.SetEnumeratorSwitchSet( enum_set );
int32_t AddEnumerator(BaseEnumerator *input)
Adds an Enumerator.
Definition: enumerator_switch_set.cpp:92
void SetEnumeratorSwitchSet(EnumeratorSwitchSet *input)
Sets the enumerator switch set to be used for this parameter.
Definition: parameter.cpp:2093
This class maps ranges of unsigned integer values to strings for enumeration.
Definition: range_enumerator.h:21
int32_t Add(uint32_t start_value, const char *str_value_ptr, uint32_t end_value=0)
Adds the string value as enumeration for the unsigned integer value range.
Definition: range_enumerator.cpp:152

◆ SetEnumeratorSwitchSet() [2/2]

void trek::Parameter::SetEnumeratorSwitchSet ( EnumeratorSwitchSet input)

Sets the enumerator switch set to be used for this parameter.

The enumerator switched set can contain any of the supplied TReK enumerators such as RangeEnumerator. The Parameter class makes a copy of the enumerator switch set. If an enumerator or enumerator switch set already exists, it will be replaced.

Parameters
[in]inputThe new enumerator switch set.

Example:

e.SetName( "a" );
e.Add( 0, "zero" );
e.Add( 1, "one" );
e.Add( 2, "two" );
e.Add( 3, "three" );
re.SetName( "b" );
re.Add( 0, "zero or one", 1 );
re.Add( 2, "two or three", 3 );
enum_set.AddEnumerator( &e );
enum_set.AddEnumerator( &re );
enum_set.SetDefaultSetName( "a" );
enum_set.SetSwitchParameterName( "another_parameter" );
enum_set.AddRangeSwitch( 0, 5, "a" );
enum_set.AddRangeSwitch( 5, 255, "b" );
p.SetEnumeratorSwitchSet( &enum_set );

◆ SetExpectedStateAlarm()

void trek::Parameter::SetExpectedStateAlarm ( ExpectedStateAlarm input)

Sets the expected state to be used for this parameter.

Parameters
[in]inputThe new expected state alarm. If an alarm already exists, it will be replaced. If any limits exist, they will be deleted.

Example:

esa.SetExpectedState( "GOOD" );
void SetExpectedState(const char *input)
Sets the expected type for the alarm.
Definition: expected_state_alarm.cpp:232
void SetExpectedStateAlarm(ExpectedStateAlarm &input)
Sets the expected state to be used for this parameter.
Definition: parameter.cpp:2434

◆ SetExpectedStateAlarmSwitchSet()

void trek::Parameter::SetExpectedStateAlarmSwitchSet ( ExpectedStateAlarmSwitchSet input)

Sets the expected state switch set to be used for this parameter.

The expected state switched set can contains on or more ExpectedStateAlarm objects. The Parameter class makes a copy of the expected state alarm. If a expected state alarm or expected state alarm switch set already exists, it will be replaced.

Parameters
[in]inputThe new expected state alarm switch set.

Example:

esa1.SetName( "first" );
esa1.SetExpectedState( "left" );
esa2.SetName( "second" );
esa2.SetExpectedState( "right" );
es_set.AddExpectedStateAlarm( esa1 );
es_set.AddExpectedStateAlarm( esa2 );
es_set.SetDefaultSetName( "first" );
es_set.SetSwitchParameterName( "another_parameter" );
es_set.AddRangeSwitch( 0, 5, "first" );
es_set.AddRangeSwitch( 5, 255, "second" );
int32_t AddExpectedStateAlarm(ExpectedStateAlarm *input)
Adds an expected state alarm.
Definition: expected_state_alarm_switch_set.cpp:89
void SetExpectedStateAlarmSwitchSet(ExpectedStateAlarmSwitchSet &input)
Sets the expected state switch set to be used for this parameter.
Definition: parameter.cpp:2484

◆ SetExternalNumSamplesParameter()

void trek::Parameter::SetExternalNumSamplesParameter ( const char *  name)

Sets the name of the parameter to use as the number of samples available for the parameter.

If the external number of samples parameter is set, the value set with SetNumberOfSamples will be considered the maximum number of samples allowed.

Parameters
[in]nameThe name of the parameter holding the external number of samples (full name???)

◆ SetExternalStatusParameter()

void trek::Parameter::SetExternalStatusParameter ( const char *  name)

Sets the name of the parameter to use as the source status for the parameter.

If the external status parameter is set, parameter will return the value referenced by the name as the source status in calls to GetValue().

Parameters
[in]nameThe name of the parameter holding the external number of samples (full name???)

◆ SetFullName()

void trek::Parameter::SetFullName ( const char *  input)

Sets the full name for the parameter.

Only used internally to TReK.

Parameters
[in]inputThe full name for the parameter.

Example:

char *name = "PacketName/h/Length"; // that's what a full name looks like for the length parameter in a header
p.SetFullName( name );
void SetFullName(const char *input)
Sets the full name for the parameter.
Definition: parameter.cpp:2853

◆ SetHighRangeFlag()

void trek::Parameter::SetHighRangeFlag ( bool  input)

Sets the high range flag for the parameter.

A value of true indicates that the parameter's value has a high range that should be checked. The default value is false.

Parameters
[in]inputThe new high range flag for the parameter.

Example:

p.SetHighRangeFlag( false );
void SetHighRangeFlag(bool input)
Sets the high range flag for the parameter.
Definition: parameter.cpp:2554

◆ SetIntegerHighRange()

int32_t trek::Parameter::SetIntegerHighRange ( int64_t  input)

Sets the high range value for a parameter that is stored as a signed integer (ST_SIGNED_64).

The input value must be greater than the current low range value for the parameter if the low range is in use. If successful, the high range flag is automatically set to true to indicate that the high range will be used.

Parameters
[in]inputThe new high range value for the parameter.
Returns
SUCCESS
TREK_DATA_VALUE_RANGE_ERROR
TREK_DATA_INVALID_INPUT_FOR_DATA_TYPE

Example:

int32_t ret_value;
ret_value = p.SetIntegerHighRange( 4267 );
if( ret_value )
printf("Error %d.\n", ret_value );
else
printf("High range set\n" );
int32_t SetIntegerHighRange(int64_t input)
Sets the high range value for a parameter that is stored as a signed integer (ST_SIGNED_64).
Definition: parameter.cpp:2629

◆ SetIntegerLowRange()

int32_t trek::Parameter::SetIntegerLowRange ( int64_t  input)

Sets the low range value for a parameter that is stored as a signed integer (ST_SIGNED_64).

The input value must be less than the current high range value for the parameter if the high range is in use. If successful, the low range flag is automatically set to true to indicate that the low range will be used.

Parameters
[in]inputThe new low range value for the parameter.
Returns
SUCCESS
TREK_DATA_VALUE_RANGE_ERROR
TREK_DATA_INVALID_INPUT_FOR_DATA_TYPE

Example:

int32_t ret_value;
ret_value = p.SetIntegerLowRange( 15 );
if( ret_value )
printf("Error %d.\n", ret_value );
else
printf("Low range set\n" );
int32_t SetIntegerLowRange(int64_t input)
Sets the low range value for a parameter that is stored as a signed integer (ST_SIGNED_64).
Definition: parameter.cpp:2582

◆ SetLimitAlarmSwitchSet()

void trek::Parameter::SetLimitAlarmSwitchSet ( LimitAlarmSwitchSet input)

Sets the limit alarm switch set to be used for this parameter.

The limit alarm switched set can contains on or more LimitAlarm objects. The Parameter class makes a copy of the limit alarm. If a limit alarm or limit alarm switch set already exists, it will be replaced.

Parameters
[in]inputThe new limit alarm switch set.

Example:

la1.SetName( "first" );
la1.SetHighLimit( 2, 20.0 );
la1.SetHighLimit( 4, 40.56 )'
la2.SetName( "second" );
la2.SetLowLimit( 1, -0.5);
limit_set.AddLimitAlarm( la1 );
limit_set.AddLimitAlarm( la2 );
limit_set.SetDefaultSetName( "first" );
limit_set.SetSwitchParameterName( "another_parameter" );
limit_set.AddRangeSwitch( 0, 5, "first" );
limit_set.AddRangeSwitch( 5, 255, "second" );
p.SetLimitAlarmSwitchSet( &limit_set );
int32_t SetHighLimit(uint32_t level, double value)
Sets the high limit for the specified level.
Definition: limit_alarm.cpp:1170

◆ SetLimits()

void trek::Parameter::SetLimits ( LimitAlarm input)

Sets the limits to be used for this parameter.

Parameters
[in]inputThe new limits. If limits already exists, they will be replaced. This will also remove any expected state alarms.
Note
If calibration is available, the parameter's value will be calibratred prior to limit checks.

Example:

la.SetHighLimit( 1, 1000.0 );
la.SetLowLimit( 1, 500.0 );
la.SetLowLimit( 2, 400.0 );
p.SetLimits( la );
int32_t SetLowLimit(uint32_t level, double value)
Sets the low limit for the specified level.
Definition: limit_alarm.cpp:1393
void SetLimits(LimitAlarm &input)
Sets the limits to be used for this parameter.
Definition: parameter.cpp:2339

◆ SetLowRangeFlag()

void trek::Parameter::SetLowRangeFlag ( bool  input)

Sets the low range flag for the parameter.

A value of true indicates that the parameter's value has a low range that should be checked. The default value is false.

Parameters
[in]inputThe new low range flag for the parameter.

Example:

p.SetLowRangeFlag( false );
void SetLowRangeFlag(bool input)
Sets the low range flag for the parameter.
Definition: parameter.cpp:2538

◆ SetModifiableFlag()

void trek::Parameter::SetModifiableFlag ( bool  input)

Sets the modifiable flag for the parameter.

True indicates that the parameter can be modified. The default value is true.

Parameters
[in]inputThe new modifiable flag for the parameter.

Example:

p.SetModifiableFlag( false );
void SetModifiableFlag(bool input)
Sets the modifiable flag for the parameter.
Definition: parameter.cpp:2522
Examples
define_packet/define_packet.cpp, and integrate_user_calibrator/integrate_user_calibrator.cpp.

◆ SetNumberOfSamples()

int32_t trek::Parameter::SetNumberOfSamples ( uint32_t  input)

Sets the number of samples for the parameter.

Memory will be allocated to store all of the samples. Any previous values stored will be lost. The default number of samples is 1.

Parameters
[in]inputThe new number of samples for the parameter.
Returns
SUCCESS
TREK_DATA_INVALID_SAMPLE_NUMBER
TREK_DATA_VAR_LEN_NUM_SAMPLE_ERROR

Example:

int32_t SetNumberOfSamples(uint32_t input)
Sets the number of samples for the parameter.
Definition: parameter.cpp:1747
Examples
define_packet/define_packet.cpp.

◆ SetNumberOfSyllables()

int32_t trek::Parameter::SetNumberOfSyllables ( uint32_t  input)

Sets the number of syllables for the parameter.

If the number of syllables is set the 'start bit' set by SetStartBit() will be ignored for processing. A parameter can have one or more syllables. Each syllable must have a length and start bit set using SetSyllableInfo(). The sum of the lengths for the syllables must be equal to the length of the parameter's data type as set by SetDataType(). Variable length data types cannot be multi sampled. If the number of syllables changes, all previous information about the syallables is lost.

Parameters
[in]inputThe new number of syllables for the parameter. A value of zero will erase all syllable information and use locations as set by SetStartBit().
Returns
SUCCESS
TREK_DATA_VAR_LEN_SYLLABLE_ERROR

Example:

◆ SetRangeEnumerator()

void trek::Parameter::SetRangeEnumerator ( RangeEnumerator input)

Sets the range enumerator to be used for this parameter.

If the data type cannot be retrieved with a 32-bit unsigned integer, calls to GetEnumeratedValue will fail.

Parameters
[in]inputThe new enumerator. If a enumerator already exists, it will be replaced.

Example:

e.Add( 0, "Off", 0 );
e.Add( 1, "On", 255 );

◆ SetSampleOffset()

void trek::Parameter::SetSampleOffset ( uint32_t  input)

Sets the sample offset for the parameter.

The sample offset is the number of bits between the end of one sample and the beginning of the next sample. The default value is 0. Only applicable for parameters with number of samples greater than 1.

Parameters
[in]inputThe new sample offset for the parameter.

Example:

void SetSampleOffset(uint32_t input)
Sets the sample offset for the parameter.
Definition: parameter.cpp:1788
Examples
define_packet/define_packet.cpp.

◆ SetStartBit()

int32_t trek::Parameter::SetStartBit ( uint32_t  input)

Sets the start location for the parameter as bits.

Bit numbers begin at 0. The default start bit is 0.

Parameters
[in]inputThe new start bit for the parameter.
Returns
SUCCESS

Example:

p.SetStartBit( 128 );
int32_t SetStartBit(uint32_t input)
Sets the start location for the parameter as bits.
Definition: parameter.cpp:1725
Examples
define_packet/define_packet.cpp, and integrate_user_calibrator/integrate_user_calibrator.cpp.

◆ SetSyllableInfo()

int32_t trek::Parameter::SetSyllableInfo ( uint32_t  syll_num,
uint32_t  start_bit,
uint32_t  length 
)

Sets the start bit and length for a syllable in a parameter.

Parameters
[in]syll_numThe syllable number to change for the parameter. Syllable numbers start at 1.
[in]start_bitThe new start bit for the syllable.
[in]lengthThe new length for the syllable.
Returns
SUCCESS
TREK_DATA_BAD_SYLLABLE_NUMBER

Example:

◆ SetUnsignedHighRange()

int32_t trek::Parameter::SetUnsignedHighRange ( uint64_t  input)

Sets the high range value for a parameter that is stored as an unsigned integer (ST_UNSIGNED_64).

The input value must be greater than the current low range value for the parameter if the low range is in use. If successful, the high range flag is automatically set to true to indicate that the high range will be used.

Parameters
[in]inputThe new high range value for the parameter.
Returns
SUCCESS
TREK_DATA_VALUE_RANGE_ERROR
TREK_DATA_INVALID_INPUT_FOR_DATA_TYPE

Example:

int32_t ret_value;
ret_value = p.SetUnsignedHighRange( 4267 );
if( ret_value )
printf("Error %d.\n", ret_value );
else
printf("High range set\n" );
int32_t SetUnsignedHighRange(uint64_t input)
Sets the high range value for a parameter that is stored as an unsigned integer (ST_UNSIGNED_64).
Definition: parameter.cpp:2723

◆ SetUnsignedLowRange()

int32_t trek::Parameter::SetUnsignedLowRange ( uint64_t  input)

Sets the low range value for a parameter that is stored as an unsigned integer (ST_UNSIGNED_64).

The input value must be less than the current high range value for the parameter if the high range is in use. If successful, the low range flag is automatically set to true to indicate that the low range will be used.

Parameters
[in]inputThe new low range value for the parameter.
Returns
SUCCESS
TREK_DATA_VALUE_RANGE_ERROR
TREK_DATA_INVALID_INPUT_FOR_DATA_TYPE

Example:

int32_t ret_value;
ret_value = p.SetUnsignedLowRange( 15 );
if( ret_value )
printf("Error %d.\n", ret_value );
else
printf("Low range set\n" );
int32_t SetUnsignedLowRange(uint64_t input)
Sets the low range value for a parameter that is stored as an unsigned integer (ST_UNSIGNED_64).
Definition: parameter.cpp:2676

◆ SetValue() [1/14]

int32_t trek::Parameter::SetValue ( bool  input,
uint16_t  sample_number = 1 
)

Sets the value of the parameter with a boolean.

Parameters
[in]inputthe new value
[in]sample_numberOptional parameter to set the specified sample number. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_NOT_MODIFIABLE
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_VALUE_LESS_THAN_MIN
TREK_DATA_VALUE_EXCEEDS_MAX

Example:

int32_t ret_value;
ret_value = p.SetValue( false ); // use the default 'first' sample
if( ret_value )
{
// process errors
}
else
printf("Value set\n");
int32_t SetValue(int8_t input, uint16_t sample_number=1)
Sets the value of the parameter with an 8-bit signed integer.
Definition: parameter.cpp:6151

◆ SetValue() [2/14]

int32_t trek::Parameter::SetValue ( const char *  input_ptr,
uint16_t  sample_number = 1 
)

Sets the value of the parameter with a NULL terminated string.

If input is larger than the parameter's size allows, the value will be truncated and TREK_DATA_POSSIBLE_LOSS_OF_DATA returned.

Parameters
[in]input_ptrthe new value
[in]sample_numberOptional parameter to set the specified sample number. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_NOT_MODIFIABLE
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_VALUE_LESS_THAN_MIN
TREK_DATA_VALUE_EXCEEDS_MAX
TREK_DATA_NULL_PTR

Example:

int32_t ret_value;
char my_value[100];
strcpy( my_value, "ThisIsNew" );
ret_value = p.SetValue( my_value ); // use the default 'first' sample
if( ret_value )
{
// process errors
}
else
printf("Value set\n");

◆ SetValue() [3/14]

int32_t trek::Parameter::SetValue ( double  input,
uint16_t  sample_number = 1 
)

Sets the value of the parameter with a 64-bit floating point.

Parameters
[in]inputthe new value
[in]sample_numberOptional parameter to set the specified sample number. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_NOT_MODIFIABLE
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_VALUE_LESS_THAN_MIN
TREK_DATA_VALUE_EXCEEDS_MAX

Example:

int32_t ret_value;
double my_value;
my_value = 0.0003465;
ret_value = p.SetValue( my_value ); // use the default 'first' sample
if( ret_value )
{
// process errors
}
else
printf("Value set\n");

◆ SetValue() [4/14]

int32_t trek::Parameter::SetValue ( float  input,
uint16_t  sample_number = 1 
)

Sets the value of the parameter with a 32-bit floating point.

Parameters
[in]inputthe new value
[in]sample_numberOptional parameter to set the specified sample number. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_NOT_MODIFIABLE
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_VALUE_LESS_THAN_MIN
TREK_DATA_VALUE_EXCEEDS_MAX

Example:

int32_t ret_value;
float my_value;
my_value = -56.136;
ret_value = p.SetValue( my_value ); // use the default 'first' sample
if( ret_value )
{
// process errors
}
else
printf("Value set\n");

◆ SetValue() [5/14]

int32_t trek::Parameter::SetValue ( int16_t  input,
uint16_t  sample_number = 1 
)

Sets the value of the parameter with a 16-bit signed integer.

Parameters
[in]inputthe new value
[in]sample_numberOptional parameter to set the specified sample number. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_NOT_MODIFIABLE
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_VALUE_LESS_THAN_MIN
TREK_DATA_VALUE_EXCEEDS_MAX

Example:

int32_t ret_value;
int16_t my_value;
my_value = -4923;
ret_value = p.SetValue( my_value ); // use the default 'first' sample
if( ret_value )
{
// process errors
}
else
printf("Value set\n");

◆ SetValue() [6/14]

int32_t trek::Parameter::SetValue ( int32_t  input,
uint16_t  sample_number = 1 
)

Sets the value of the parameter with a 32-bit signed integer.

Parameters
[in]inputthe new value
[in]sample_numberOptional parameter to set the specified sample number. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_NOT_MODIFIABLE
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_VALUE_LESS_THAN_MIN
TREK_DATA_VALUE_EXCEEDS_MAX

Example:

int32_t ret_value;
int32_t my_value;
my_value = 492351;
ret_value = p.SetValue( my_value ); // use the default 'first' sample
if( ret_value )
{
// process errors
}
else
printf("Value set\n");

◆ SetValue() [7/14]

int32_t trek::Parameter::SetValue ( int64_t  input,
uint16_t  sample_number = 1 
)

Sets the value of the parameter with a 64-bit signed integer.

Parameters
[in]inputthe new value
[in]sample_numberOptional parameter to set the specified sample number. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_NOT_MODIFIABLE
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_VALUE_LESS_THAN_MIN
TREK_DATA_VALUE_EXCEEDS_MAX

Example:

int32_t ret_value;
int64_t my_value;
my_value = 492342221351;
ret_value = p.SetValue( my_value ); // use the default 'first' sample
if( ret_value )
{
// process errors
}
else
printf("Value set\n");

◆ SetValue() [8/14]

int32_t trek::Parameter::SetValue ( int8_t  input,
uint16_t  sample_number = 1 
)

Sets the value of the parameter with an 8-bit signed integer.

Parameters
[in]inputthe new value
[in]sample_numberOptional parameter to set the specified sample number. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_NOT_MODIFIABLE
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_VALUE_LESS_THAN_MIN
TREK_DATA_VALUE_EXCEEDS_MAX

Example:

int32_t ret_value;
int8_t my_value;
my_value = -3;
ret_value = p.SetValue( my_value ); // use the default 'first' sample
if( ret_value )
{
// process errors
}
else
printf("Value set\n");
Examples
build_packet/build_packet.cpp, define_packet/define_packet.cpp, and integrate_user_calibrator/integrate_user_calibrator.cpp.

◆ SetValue() [9/14]

int32_t trek::Parameter::SetValue ( TrekTime input,
uint16_t  sample_number = 1 
)

Sets the value of the parameter with a TrekTime object.

Parameters
[in]inputthe new value
[in]sample_numberOptional parameter to set the specified sample number. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_NOT_MODIFIABLE
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_VALUE_LESS_THAN_MIN
TREK_DATA_VALUE_EXCEEDS_MAX

Example:

int32_t ret_value;
TrekTime my_value;
my_value.Set(); // set to the current time.
ret_value = p.SetValue( my_value ); // use the default 'first' sample
if( ret_value )
{
// process errors
}
else
printf("Value set\n");

◆ SetValue() [10/14]

int32_t trek::Parameter::SetValue ( uint16_t  input,
uint16_t  sample_number = 1 
)

Sets the value of the parameter with a 16-bit unsigned integer.

Parameters
[in]inputthe new value
[in]sample_numberOptional parameter to set the specified sample number. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_NOT_MODIFIABLE
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_VALUE_LESS_THAN_MIN
TREK_DATA_VALUE_EXCEEDS_MAX

Example:

int32_t ret_value;
uint16_t my_value;
my_value = 1923;
ret_value = p.SetValue( my_value ); // use the default 'first' sample
if( ret_value )
{
// process errors
}
else
printf("Value set\n");

◆ SetValue() [11/14]

int32_t trek::Parameter::SetValue ( uint32_t  input,
uint16_t  sample_number = 1 
)

Sets the value of the parameter with a 32-bit unsigned integer.

Parameters
[in]inputthe new value
[in]sample_numberOptional parameter to set the specified sample number. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_NOT_MODIFIABLE
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_VALUE_LESS_THAN_MIN
TREK_DATA_VALUE_EXCEEDS_MAX

Example:

int32_t ret_value;
uint32_t my_value;
my_value = 492351;
ret_value = p.SetValue( my_value ); // use the default 'first' sample
if( ret_value )
{
// process errors
}
else
printf("Value set\n");

◆ SetValue() [12/14]

int32_t trek::Parameter::SetValue ( uint64_t  input,
uint16_t  sample_number = 1 
)

Sets the value of the parameter with a 64-bit unsigned integer.

Parameters
[in]inputthe new value
[in]sample_numberOptional parameter to set the specified sample number. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_NOT_MODIFIABLE
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_VALUE_LESS_THAN_MIN
TREK_DATA_VALUE_EXCEEDS_MAX

Example:

int32_t ret_value;
uint64_t my_value;
my_value = 492342221351;
ret_value = p.SetValue( my_value ); // use the default 'first' sample
if( ret_value )
{
// process errors
}
else
printf("Value set\n");

◆ SetValue() [13/14]

int32_t trek::Parameter::SetValue ( uint8_t *  input_ptr,
uint32_t  input_len,
uint16_t  sample_number = 1 
)

Sets the value of the parameter with binary data.

If input is larger than the parameter's size allows, the value will be truncated and TREK_DATA_POSSIBLE_LOSS_OF_DATA returned.

Note
If the provided data is less than the size of the parameter and the parameter is not variable length, the data will be left justified and the remaining bytes set to zero.
Parameters
[in]input_ptrThe new value.
[in]input_lenThe length of the input in bits.
[in]sample_numberOptional parameter to set the specified sample number. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_NOT_MODIFIABLE
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_VALUE_LESS_THAN_MIN
TREK_DATA_VALUE_EXCEEDS_MAX
TREK_DATA_NULL_PTR

Example:

int32_t ret_value;
uint8_t my_value[100];
for( uint8_t ii = 0; ii < 100; ii++ )
my_value[ii] = ii*2;
ret_value = p.SetValue( my_value, 100 ); // use the default 'first' sample
if( ret_value )
{
// process errors
}
else
printf("Value set\n");

◆ SetValue() [14/14]

int32_t trek::Parameter::SetValue ( uint8_t  input,
uint16_t  sample_number = 1 
)

Sets the value of the parameter with an 8-bit unsigned integer.

Parameters
[in]inputthe new value
[in]sample_numberOptional parameter to set the specified sample number. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_NOT_MODIFIABLE
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_VALUE_LESS_THAN_MIN
TREK_DATA_VALUE_EXCEEDS_MAX

Example:

int32_t ret_value;
uint8_t my_value;
my_value = 3;
ret_value = p.SetValue( my_value ); // use the default 'first' sample
if( ret_value )
{
// process errors
}
else
printf("Value set\n");

◆ SetValueFromString()

int32_t trek::Parameter::SetValueFromString ( const char *  value_str,
parameter_data_format  data_fmt,
uint16_t  sample_number = 1 
)

Sets the value of the parameter from a string by interpreting the format.

The valid data type - data format combinations are shown in the table below.

Data Type DF_ASCII DF_BINARY DF_DECIMAL DF_SCIENTIFIC* DF_HEX DF_BOOLEAN

DF_DATE_TIME

DT_TWOS_COMPLEMENT X

DT_UNSIGNED_INTEGER X X X

DT_DISTENDED_SIGNED_INTEGER X

DT_SIGN_AND_MAGNITUDE_INTEGER X

DT_BINARY_CODED_DECIMAL X

DT_IEEE_FLOATING_POINT X

DT_NULL_TERMINATED_STRING X

DT_FIXED_LENGTH_STRING X

DT_BOOLEAN X

DT_UNSPECIFIED_BYTES X X

DT_GPS_EPOCH_TIME

X

DT_EHS_TIME

X

DT_ISS_TIME

X

DT_FASTSAT_TIME

X

DT_DEM_TIME

X

DT_UNIX_TIME

X

DT_EHS_CONV_TIME

X

DT_ISAT_TIME X

Not currently implemented.

Parameters
[in]value_strThe new value formatted according to data_fmt.
[in]data_fmtThe format that value_str should be interpreted as.
[in]sample_numberOptional parameter to set the specified sample number. Default value is 1 (first sample).
Returns
SUCCESS
TREK_DATA_NOT_MODIFIABLE
TREK_DATA_SAMPLE_DOES_NOT_EXIST
TREK_DATA_POSSIBLE_LOSS_OF_DATA
TREK_DATA_INVALID_INPUT_FOR_TYPE
TREK_DATA_INVALID_DATA_TYPE
TREK_DATA_VALUE_LESS_THAN_MIN
TREK_DATA_VALUE_EXCEEDS_MAX
TREK_DATA_INVALID_CHAR_INPUT
TREK_DATA_NOT_BOOLEAN_TYPE
TREK_DATA_WILL_NOT_FIT
TREK_DATA_NULL_PTR

Example:

int32_t ret_value;
std::string my_value;
my_value = "ABCD1234"
ret_value = p.SetValueFromString( my_value, DF_HEX ); // use the default 'first' sample
if( ret_value )
{
// process errors
}
else
printf("Value set\n");
int32_t SetValueFromString(const char *value_str, parameter_data_format data_fmt, uint16_t sample_number=1)
Sets the value of the parameter from a string by interpreting the format.
Definition: parameter.cpp:7913

◆ UseHighRange()

bool trek::Parameter::UseHighRange ( )

Identifies if a high range value is currently in use.

Returns true is high range is in use. Otherwise, returns false.

Example:

if( p.UseHighRange() )
printf("High range is in use\n");

◆ UseLowRange()

bool trek::Parameter::UseLowRange ( )

Identifies if a low range value is currently in use.

Returns true is low range is in use. Otherwise, returns false.

Example:

if( p.UseLowRange() )
printf("Low range is in use\n");

◆ Validate()

bool trek::Parameter::Validate ( uint32_t &  num_errors,
uint32_t &  num_warnings,
const char **  validation_messages = 0 
)

Validates the parameter.

The Parameter class by default will not allow invalid input. If you call Parameter::AllowInvalidData() then you must call this method and it must return true prior to using many of the other methods (e.g., GetValue(), Build(), ToXml()). This allows input of data in any order. A parameter is considered valid if only warnings are found.

Parameters
[out]validation_messagesA character string of all validation messages. Memory is owned by parameter object.
[out]num_errorsNumber of errors found.
[out]num_warningsNumber of warnings found.
Returns
true Parameter is valid
false Parameter is invalid

Example:

uint32_t err, warn;
const char *msg;
p.SetDataFormat( DF_DATA_TIME ); // would normally fail as default data type is unsigned integer
if( p.IsValid() )
printf( "This shouldn't occur since Validate must be called to check.\n" );
if( p.Validate( err, warn, &msg ) )
printf( "Parameter is ok\n" );
else
{
// invalid data print the errors
printf( "%s\n", msg );
}
// now this function might succeed
if( p.IsValid() )
printf( "Parameter is valid.\n" );