Changeset 18608 for trunk/psModules/src/concepts/pmConceptsAverage.c
- Timestamp:
- Jul 17, 2008, 3:45:43 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/concepts/pmConceptsAverage.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/concepts/pmConceptsAverage.c
r17424 r18608 232 232 PS_ASSERT_INT_POSITIVE(sources->n, false); 233 233 234 float temp = 0.0;// Temperature234 float temp = 0.0; // Temperature 235 235 int x0 = 0, y0 = 0; // Offset 236 236 int xParity = 0, yParity = 0; // Parity 237 int xSize = 0, ySize = 0; 238 psString id = NULL;239 240 int nChips = 0; // Number of c ells;237 int xSize = 0, ySize = 0; // Size 238 psString id = NULL; // Identifier 239 240 int nChips = 0; // Number of chips; 241 241 psListIterator *sourcesIter = psListIteratorAlloc(sources, PS_LIST_HEAD, false); // Iterator for sources 242 pmChip *chip = NULL; // Source c ellfrom iteration242 pmChip *chip = NULL; // Source chip from iteration 243 243 while ((chip = psListGetAndIncrement(sourcesIter))) { 244 244 if (!chip) { … … 246 246 } 247 247 temp += psMetadataLookupF32(NULL, chip->concepts, "CHIP.TEMP"); 248 if (nChips == 1) {248 if (nChips == 0) { 249 249 xSize = psMetadataLookupS32(NULL, chip->concepts, "CHIP.XSIZE"); 250 250 ySize = psMetadataLookupS32(NULL, chip->concepts, "CHIP.YSIZE"); … … 256 256 } else { 257 257 if (xSize != psMetadataLookupS32(NULL, chip->concepts, "CHIP.XSIZE")) { 258 psWarning("Differing CHIP.XSIZE in use: %d vs %d\n", 258 psWarning("Differing CHIP.XSIZE in use: %d vs %d\n", 259 259 xSize, psMetadataLookupS32(NULL, chip->concepts, "CHIP.XSIZE")); 260 260 } 261 261 if (ySize != psMetadataLookupS32(NULL, chip->concepts, "CHIP.YSIZE")) { 262 psWarning("Differing CHIP.YSIZE in use: %d vs %d\n", 262 psWarning("Differing CHIP.YSIZE in use: %d vs %d\n", 263 263 ySize, psMetadataLookupS32(NULL, chip->concepts, "CHIP.YSIZE")); 264 264 } 265 265 if (xParity != psMetadataLookupS32(NULL, chip->concepts, "CHIP.XPARITY")) { 266 psWarning("Differing CHIP.XPARITY in use: %d vs %d\n", 266 psWarning("Differing CHIP.XPARITY in use: %d vs %d\n", 267 267 xParity, psMetadataLookupS32(NULL, chip->concepts, "CHIP.XPARITY")); 268 268 } 269 269 if (yParity != psMetadataLookupS32(NULL, chip->concepts, "CHIP.YPARITY")) { 270 psWarning("Differing CHIP.YPARITY in use: %d vs %d\n", 270 psWarning("Differing CHIP.YPARITY in use: %d vs %d\n", 271 271 yParity, psMetadataLookupS32(NULL, chip->concepts, "CHIP.YPARITY")); 272 272 } 273 273 if (x0 != psMetadataLookupS32(NULL, chip->concepts, "CHIP.X0")) { 274 psWarning("Differing CHIP.X0 in use: %d vs %d\n", 274 psWarning("Differing CHIP.X0 in use: %d vs %d\n", 275 275 x0, psMetadataLookupS32(NULL, chip->concepts, "CHIP.X0")); 276 276 } 277 277 if (y0 != psMetadataLookupS32(NULL, chip->concepts, "CHIP.Y0")) { 278 psWarning("Differing CHIP.Y0 in use: %d vs %d\n", 278 psWarning("Differing CHIP.Y0 in use: %d vs %d\n", 279 279 y0, psMetadataLookupS32(NULL, chip->concepts, "CHIP.Y0")); 280 280 } … … 284 284 } 285 285 } 286 286 287 287 nChips++; 288 288 } 289 289 psFree(sourcesIter); 290 290 291 temp /= (float)nChips;291 temp /= (float)nChips; 292 292 293 293 MD_UPDATE(target->concepts, "CHIP.TEMP", F32, temp);
Note:
See TracChangeset
for help on using the changeset viewer.
