42#if defined __cplusplus
47static int nlab_Str = 0, nCOM_Str = 0;
48static char lab_Str[] =
"lab", COM_Str[] =
"centerOfMass";
81 smr_setMessageError( smr, NULL, __FILE__, __LINE__, 1,
"dimension argument = %d is greater than tpia_maxNumberOfFrames = %d", dimension,
85 for( i = 0, e = value; ( i < dimension ) && ( *e != 0 ); i++ ) {
86 if( strstr( e, lab_Str ) == e ) {
89 else if( strstr( e, COM_Str ) == e ) {
93 smr_setMessageError( smr, NULL, __FILE__, __LINE__, 1,
"bad frame '%s' for %s", value, forItem );
98 smr_setMessageError( smr, NULL, __FILE__, __LINE__, 1,
"bad separater for frame '%s' for %s", value, forItem );
105 if( i == dimension ) {
109 smr_setMessageError( smr, NULL, __FILE__, __LINE__, 1,
"extra values for frame '%s' for %s", value, forItem );
112 smr_setMessageError( smr, NULL, __FILE__, __LINE__, 1,
"missing values for frame '%s' for %s", value, forItem );
123 int i, dimension = 0;
124 unsigned value = frame->
frames;
127 if( ( value & 3 ) == 0 )
break;
140 char *str = NULL, *p;
142 if( nlab_Str == 0 ) {
143 nlab_Str = strlen( lab_Str );
144 nCOM_Str = strlen( COM_Str );
146 for( i = 0; i < n; i++ ) {
149 nStr += nCOM_Str + 1; }
151 nStr += nlab_Str + 1; }
153 smr_setMessageError( smr, NULL, __FILE__, __LINE__, 1,
"bad frame value = %d for column = %d", value, i );
157 if( nStr == 0 ) nStr = 1;
159 if( ( str = (
char*)
xData_malloc2( smr, nStr, 1,
"str" ) ) == NULL )
return( NULL );
160 for( i = 0, p = str - 1; i < n; i++ ) {
164 strcpy( p, COM_Str );
167 strcpy( p, lab_Str );
183 for( i = 0; i < nColumns; i++ )
if(
tpia_frame_setColumn( smr, frame, i, values[i] ) != 0 )
return( 1 );
199 smr_setMessageError( smr, NULL, __FILE__, __LINE__, 1,
"bad frame value = %d for column = %d", value, column );
202 i = 3 << ( 2 * column );
204 value = value << ( 2 * column );
221 value = frame->
frames >> ( 2 * column );
223 return( (
int) ( value & 3 ) );
226#if defined __cplusplus
int smr_setMessageError(statusMessageReporting *smr, void *userInterface, const char *file, int line, int code, const char *fmt,...)
int smr_isOk(statusMessageReporting *smr)
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_lab
int tpia_frame_setFromElement(statusMessageReporting *smr, xData_element *element, int dimension, tpia_data_frame *frame)
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)
int tpia_frame_setColumns(statusMessageReporting *smr, tpia_data_frame *frame, int nColumns, int *values)
#define tpia_referenceFrame_None
#define tpia_referenceFrame_Max
char * tpia_frame_toString(statusMessageReporting *smr, const char *fromItem, tpia_data_frame *frame)
#define tpia_referenceFrame_COM
int tpia_frame_setColumn(statusMessageReporting *smr, tpia_data_frame *frame, int column, int value)
#define tpia_maxNumberOfFrames
const char * xData_getAttributesValueInElement(xData_element *element, const char *name)
#define xData_malloc2(smr, size, zero, forItem)