Changeset 17898 for trunk/psModules/src/concepts/pmConceptsStandard.c
- Timestamp:
- Jun 3, 2008, 3:58:43 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/concepts/pmConceptsStandard.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/concepts/pmConceptsStandard.c
r16646 r17898 49 49 // TELTEMPS : parse a list of the form 'X1 X2 X3 X4 X5 ...' : for now use median 50 50 psMetadataItem *p_pmConceptParse_TELTEMPS(const psMetadataItem *concept, 51 const psMetadataItem *pattern,52 pmConceptSource source,53 const psMetadata *cameraFormat,54 const pmFPA *fpa,55 const pmChip *chip,56 const pmCell *cell)51 const psMetadataItem *pattern, 52 pmConceptSource source, 53 const psMetadata *cameraFormat, 54 const pmFPA *fpa, 55 const pmChip *chip, 56 const pmCell *cell) 57 57 { 58 58 assert(concept); … … 68 68 break; 69 69 case PS_DATA_STRING: { 70 // parse the list of values into an array of substrings71 psArray *strValues = psStringSplitArray (concept->data.V, " ,;", false);72 assert (strValues);73 74 // convert the substrings into a vector75 psVector *fltValues = psVectorAlloc (strValues->n, PS_DATA_F32);76 for (int i = 0; i < strValues->n; i++) {77 fltValues->data.F32[i] = atof(strValues->data[i]);78 }79 80 // take the (for now) MEDIAN of the data81 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN);82 83 if (!psVectorStats (stats, fltValues, NULL, NULL, 0)) {84 psAbort ("how can this stats function fail?");85 }86 87 value = stats->sampleMedian;88 psFree (stats);89 psFree (fltValues);90 psFree (strValues);91 break;70 // parse the list of values into an array of substrings 71 psArray *strValues = psStringSplitArray (concept->data.V, " ,;", false); 72 assert (strValues); 73 74 // convert the substrings into a vector 75 psVector *fltValues = psVectorAlloc (strValues->n, PS_DATA_F32); 76 for (int i = 0; i < strValues->n; i++) { 77 fltValues->data.F32[i] = atof(strValues->data[i]); 78 } 79 80 // take the (for now) MEDIAN of the data 81 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN); 82 83 if (!psVectorStats (stats, fltValues, NULL, NULL, 0)) { 84 psAbort ("how can this stats function fail?"); 85 } 86 87 value = stats->sampleMedian; 88 psFree (stats); 89 psFree (fltValues); 90 psFree (strValues); 91 break; 92 92 } 93 93 … … 334 334 coords -= medium / 60.0; 335 335 small = 3600.0 * coords; 336 small = (float)((int)(small * 100.0)) / 100.0; 336 337 if (negative) { 337 338 big *= -1; … … 526 527 psString sys = concept->data.V; // The time system string 527 528 if (concept->type != PS_DATA_STRING || strlen(sys) <= 0) { 528 // XXX is this too low verbosity?529 psLogMsg ("psModules.concepts", PS_LOG_DETAIL, "Can't interpret %s --- assuming UTC.\n", pattern->name);529 // XXX is this too low verbosity? 530 psLogMsg ("psModules.concepts", PS_LOG_DETAIL, "Can't interpret %s --- assuming UTC.\n", pattern->name); 530 531 } else if (strcasecmp(sys, "TAI") == 0) { 531 532 timeSys = PS_TIME_TAI; … … 537 538 timeSys = PS_TIME_TT; 538 539 } else { 539 // XXX is this too low verbosity?540 psLogMsg ("psModules.concepts", PS_LOG_DETAIL, "Can't interpret %s --- assuming UTC.\n", pattern->name);540 // XXX is this too low verbosity? 541 psLogMsg ("psModules.concepts", PS_LOG_DETAIL, "Can't interpret %s --- assuming UTC.\n", pattern->name); 541 542 } 542 543
Note:
See TracChangeset
for help on using the changeset viewer.
