43 #if defined __cplusplus
49 static const char lab_Str[] =
"lab", COM_Str[] =
"centerOfMass";
81 if( dimension > tpia_maxNumberOfFrames ) {
82 smr_setMessageError( smr, NULL, __FILE__, __LINE__, 1,
"dimension argument = %d is greater than tpia_maxNumberOfFrames = %d", dimension,
83 tpia_maxNumberOfFrames );
86 for( i = 0, e = value; ( i < dimension ) && ( *e != 0 ); i++ ) {
87 if( strstr( e, lab_Str ) == e ) {
90 else if( strstr( e, COM_Str ) == e ) {
94 smr_setMessageError( smr, NULL, __FILE__, __LINE__, 1,
"bad frame '%s' for %s", value, forItem );
99 smr_setMessageError( smr, NULL, __FILE__, __LINE__, 1,
"bad separater for frame '%s' for %s", value, forItem );
106 if( i == dimension ) {
110 smr_setMessageError( smr, NULL, __FILE__, __LINE__, 1,
"extra values for frame '%s' for %s", value, forItem );
113 smr_setMessageError( smr, NULL, __FILE__, __LINE__, 1,
"missing values for frame '%s' for %s", value, forItem );
124 int i, dimension = 0;
128 if( ( value & 3 ) == 0 )
break;
141 char *str = NULL, *
p;
143 if( nlab_Str == 0 ) {
144 nlab_Str = strlen( lab_Str );
145 nCOM_Str = strlen( COM_Str );
147 for( i = 0; i <
n; i++ ) {
150 nStr += nCOM_Str + 1; }
152 nStr += nlab_Str + 1; }
158 if( nStr == 0 ) nStr = 1;
160 if( ( str = (
char*)
xData_malloc2( smr, nStr, 1,
"str" ) ) == NULL )
return( NULL );
161 for( i = 0, p = str - 1; i <
n; i++ ) {
165 strcpy( p, COM_Str );
168 strcpy( p, lab_Str );
184 for( i = 0; i < nColumns; i++ )
if(
tpia_frame_setColumn( smr, frame, i, values[i] ) != 0 )
return( 1 );
200 smr_setMessageError( smr, NULL, __FILE__, __LINE__, 1,
"bad frame value = %d for column = %d", value, column );
203 i = 3 << ( 2 * column );
205 value = value << ( 2 * column );
222 value = frame->
frames >> ( 2 * column );
224 return( (
int) ( value & 3 ) );
227 #if defined __cplusplus
int smr_setMessageError(statusMessageReporting *smr, void *userInterface, const char *file, int line, int code, const char *fmt,...)
#define tpia_maxNumberOfFrames
#define tpia_referenceFrame_None
#define xData_malloc2(smr, size, zero, forItem)
const char * xData_getAttributesValueInElement(xData_element *element, const char *name)
int tpia_frame_setFromElement(statusMessageReporting *smr, xData_element *element, int dimension, tpia_data_frame *frame)
int tpia_frame_setColumn(statusMessageReporting *smr, tpia_data_frame *frame, int column, int value)
int tpia_misc_setMessageError_Element(statusMessageReporting *smr, void *userInterface, xData_element *element, const char *file, int line, int code, const char *fmt,...)
#define tpia_referenceFrame_Max
char * tpia_frame_toString(statusMessageReporting *smr, const char *fromItem, tpia_data_frame *frame)
int smr_isOk(statusMessageReporting *smr)
#define tpia_referenceFrame_lab
int tpia_frame_setColumns(statusMessageReporting *smr, tpia_data_frame *frame, int nColumns, int *values)
#define tpia_referenceFrame_COM
const XML_Char int const XML_Char * value
int tpia_frame_getColumn(statusMessageReporting *smr, tpia_data_frame *frame, int column)
int tpia_frame_getDimensions(statusMessageReporting *smr, tpia_data_frame *frame)
int tpia_frame_setFromString(statusMessageReporting *smr, const char *forItem, const char *value, int dimension, tpia_data_frame *frame)
int tpia_frame_clear(statusMessageReporting *smr, tpia_data_frame *frame)