Changeset 5136
- Timestamp:
- Sep 26, 2005, 11:13:36 AM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 21 edited
-
src/astro/psTime.c (modified) (2 diffs)
-
src/db/psDB.c (modified) (11 diffs)
-
src/db/psDB.h (modified) (4 diffs)
-
src/fits/psFits.c (modified) (24 diffs)
-
src/sys/psType.h (modified) (3 diffs)
-
src/types/psMetadata.c (modified) (25 diffs)
-
src/types/psMetadata.h (modified) (2 diffs)
-
src/types/psMetadataConfig.c (modified) (20 diffs)
-
src/xml/psXML.c (modified) (2 diffs)
-
test/db/tst_psDB.c (modified) (7 diffs)
-
test/fits/tst_psFits.c (modified) (4 diffs)
-
test/types/tst_psMetadataIO.c (modified) (15 diffs)
-
test/types/tst_psMetadata_01.c (modified) (3 diffs)
-
test/types/tst_psMetadata_02.c (modified) (5 diffs)
-
test/types/tst_psMetadata_03.c (modified) (6 diffs)
-
test/types/tst_psMetadata_04.c (modified) (3 diffs)
-
test/types/tst_psMetadata_05.c (modified) (3 diffs)
-
test/types/tst_psMetadata_06.c (modified) (5 diffs)
-
test/types/verified/tst_psMetadata_01.stdout (modified) (11 diffs)
-
test/types/verified/tst_psMetadata_02.stdout (modified) (2 diffs)
-
test/types/verified/tst_psMetadata_06.stdout (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psTime.c
r5083 r5136 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.7 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-09-2 1 02:11:16$12 * @version $Revision: 1.72 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-09-26 21:13:12 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 397 397 if(metadataNamesPtr != NULL) { 398 398 psMetadataAdd(timeMetadata, PS_LIST_TAIL, strcat(metadataTableNames[j], "Table"), 399 PS_ META_LOOKUPTABLE, NULL, table);399 PS_DATA_LOOKUPTABLE, NULL, table); 400 400 foundTable = true; 401 401 } else if(foundTable==false && j==numTables-1) { -
trunk/psLib/src/db/psDB.c
r4891 r5136 12 12 * @author Joshua Hoblitt 13 13 * 14 * @version $Revision: 1.4 2$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-0 8-27 01:33:40$14 * @version $Revision: 1.43 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-09-26 21:13:16 $ 16 16 * 17 17 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 501 501 502 502 // copy field data and convert NULLs to the appropriate NaN value 503 if (pType == PS_ META_STR) {503 if (pType == PS_DATA_STRING) { 504 504 psMetadataAddStr(md, PS_LIST_TAIL, field[i].name, 0, "", data); 505 } else if (pType == PS_ META_S32) {505 } else if (pType == PS_DATA_S32) { 506 506 psMetadataAddS32(md, PS_LIST_TAIL, field[i].name, 0, "", atoll(data)); 507 } else if (pType == PS_ META_F32) {507 } else if (pType == PS_DATA_F32) { 508 508 psMetadataAddF32(md, PS_LIST_TAIL, field[i].name, 0, "", atof(data)); 509 } else if (pType == PS_ META_F64) {509 } else if (pType == PS_DATA_F64) { 510 510 psMetadataAddF64(md, PS_LIST_TAIL, field[i].name, 0, "", atof(data)); 511 } else if (pType == PS_ META_BOOL) {511 } else if (pType == PS_DATA_BOOL) { 512 512 psMetadataAdd(md, PS_LIST_TAIL, field[i].name, pType, "", atoi(data)); 513 513 } else { … … 710 710 // column as an psArray of strings; otherwise fetch the column as a 711 711 // psVector. 712 if (pType == PS_ META_STR) {713 // PS_ META_UNKNOWN -> PS_META_ARRAY ?712 if (pType == PS_DATA_STRING) { 713 // PS_DATA_UNKNOWN -> PS_DATA_ARRAY ? 714 714 column = psDBSelectColumn(dbh, tableName, field[i].name, 0); 715 715 psMetadataAddArray(table, PS_LIST_TAIL, field[i].name, 0, "", column); … … 946 946 ? (my_bool *)&isNull 947 947 : NULL; 948 } else if (item->type == PS_ META_STR) {948 } else if (item->type == PS_DATA_STRING) { 949 949 // convert NaNs to NULL and set the buffer_length for strings 950 950 … … 957 957 } else { 958 958 psError(PS_ERR_BAD_PARAMETER_TYPE , true, 959 "FIXME: Only type of PS_TYPE_S32 (PS_ META_S32), "960 "PS_TYPE_F32 (PS_ META_F32), PS_TYPE_F64 (PS_META_F64), "961 "PS_TYPE_BOOL (PS_ META_BOOL), "962 "and PS_ META_STRare supported.");959 "FIXME: Only type of PS_TYPE_S32 (PS_DATA_S32), " 960 "PS_TYPE_F32 (PS_DATA_F32), PS_TYPE_F64 (PS_DATA_F64), " 961 "PS_TYPE_BOOL (PS_DATA_BOOL), " 962 "and PS_DATA_STRING are supported."); 963 963 964 964 psFree(cursor); … … 1002 1002 // find column name and type 1003 1003 while ((item = psListGetAndIncrement(cursor))) { 1004 if ((item->type == PS_ META_S32) || (item->type == PS_META_F32) || (item->type == PS_META_F64) ||1004 if ((item->type == PS_DATA_S32) || (item->type == PS_DATA_F32) || (item->type == PS_DATA_F64) || 1005 1005 (item->type == PS_TYPE_S32) || (item->type == PS_TYPE_F32) || (item->type == PS_TYPE_F64) || 1006 (item->type == PS_TYPE_BOOL) || (item->type == PS_ META_BOOL)) {1006 (item->type == PS_TYPE_BOOL) || (item->type == PS_DATA_BOOL)) { 1007 1007 // + column name + _ + column type 1008 1008 colType = psDBPTypeToSQL(item->type); 1009 1009 psStringAppend(&query, "%s %s", item->name, colType); 1010 1010 psFree(colType); 1011 } else if (item->type == PS_ META_STR) {1011 } else if (item->type == PS_DATA_STRING) { 1012 1012 // + column name + _ + varchar( + length + ) 1013 1013 psStringAppend(&query, "%s VARCHAR(%s)", item->name, item->data.V); 1014 1014 } else { 1015 1015 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 1016 "FIXME: Only type of PS_ META_S32, PS_META_F32, PS_META_F64, PS_META_BOOL, "1017 "and PS_ META_STRare supported, (not %d).", item->type);1016 "FIXME: Only type of PS_DATA_S32, PS_DATA_F32, PS_DATA_F64, PS_DATA_BOOL, " 1017 "and PS_DATA_STRING are supported, (not %d).", item->type); 1018 1018 1019 1019 psFree(query); … … 1243 1243 while ((item = psListGetAndIncrement(cursor))) { 1244 1244 // item->data must be a string 1245 if ((item->type == PS_ META_S32) || (item->type == PS_TYPE_S32)) {1245 if ((item->type == PS_DATA_S32) || (item->type == PS_TYPE_S32)) { 1246 1246 psStringAppend(&query, "%s=%d", item->name, (int)(item->data.S32)); 1247 } else if ((item->type == PS_ META_F32) || (item->type == PS_TYPE_F32)) {1247 } else if ((item->type == PS_DATA_F32) || (item->type == PS_TYPE_F32)) { 1248 1248 psStringAppend(&query, "%s=%g", item->name, (double)(item->data.F32)); 1249 } else if ((item->type == PS_ META_F64) || (item->type == PS_TYPE_F64)) {1249 } else if ((item->type == PS_DATA_F64) || (item->type == PS_TYPE_F64)) { 1250 1250 psStringAppend(&query, "%s=%g", item->name, (double)(item->data.F64)); 1251 } else if ((item->type == PS_ META_BOOL) || (item->type == PS_TYPE_BOOL)) {1251 } else if ((item->type == PS_DATA_BOOL) || (item->type == PS_TYPE_BOOL)) { 1252 1252 psStringAppend(&query, "%s=%d", item->name, (int)(item->data.B)); 1253 } else if (item->type == PS_ META_STR) {1253 } else if (item->type == PS_DATA_STRING) { 1254 1254 // + column name + _ + like + _ + ' + value + ' 1255 1255 if (*(char *)item->data.V == '\0') { … … 1264 1264 } else { 1265 1265 psError(PS_ERR_BAD_PARAMETER_TYPE, true, 1266 "Only types PS_ META_S32, PS_META_F32, PS_META_F64, PS_META_BOOL, PS_META_STRare supported");1266 "Only types PS_DATA_S32, PS_DATA_F32, PS_DATA_F64, PS_DATA_BOOL, PS_DATA_STRING are supported"); 1267 1267 1268 1268 psFree(cursor); … … 1440 1440 psDBAddToLookupTable(lookupTable, PS_TYPE_C64, "PS_TYPE_C64 is not supported"); 1441 1441 psDBAddToLookupTable(lookupTable, PS_TYPE_BOOL,"TINYINT"); 1442 psDBAddToLookupTable(lookupTable, PS_ META_STR, "VARCHAR");1442 psDBAddToLookupTable(lookupTable, PS_DATA_STRING, "VARCHAR"); 1443 1443 } 1444 1444 … … 1483 1483 1484 1484 // Add BLOB & TEXT reverse mappings 1485 value = psDBIntToString((psU64)PS_ META_STR);1485 value = psDBIntToString((psU64)PS_DATA_STRING); 1486 1486 psHashAdd(lookupTable, "BLOB", value); 1487 1487 psHashAdd(lookupTable, "TEXT", value); … … 1584 1584 // psDBAddVoidToLookupTable(lookupTable, PS_TYPE_PTR, psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false)); 1585 1585 1586 psDBAddVoidToLookupTable(lookupTable, PS_ META_STR, psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false));1587 psDBAddVoidToLookupTable(lookupTable, PS_ META_VEC, psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false));1588 psDBAddVoidToLookupTable(lookupTable, PS_ META_IMG, psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false));1589 psDBAddVoidToLookupTable(lookupTable, PS_ META_HASH, psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false));1590 psDBAddVoidToLookupTable(lookupTable, PS_ META_LOOKUPTABLE,1586 psDBAddVoidToLookupTable(lookupTable, PS_DATA_STRING, psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false)); 1587 psDBAddVoidToLookupTable(lookupTable, PS_DATA_VECTOR, psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false)); 1588 psDBAddVoidToLookupTable(lookupTable, PS_DATA_IMAGE, psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false)); 1589 psDBAddVoidToLookupTable(lookupTable, PS_DATA_HASH, psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false)); 1590 psDBAddVoidToLookupTable(lookupTable, PS_DATA_LOOKUPTABLE, 1591 1591 psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false)); 1592 psDBAddVoidToLookupTable(lookupTable, PS_META_JPEG, psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false));1593 psDBAddVoidToLookupTable(lookupTable, PS_META_PNG, psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false));1594 psDBAddVoidToLookupTable(lookupTable, PS_META_ASTROM, psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false));1595 psDBAddVoidToLookupTable(lookupTable, PS_ META_UNKNOWN,psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false));1592 // psDBAddVoidToLookupTable(lookupTable, PS_DATA_JPEG, psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false)); 1593 // psDBAddVoidToLookupTable(lookupTable, PS_DATA_PNG, psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false)); 1594 // psDBAddVoidToLookupTable(lookupTable, PS_DATA_ASTROM, psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false)); 1595 psDBAddVoidToLookupTable(lookupTable, PS_DATA_UNKNOWN,psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false)); 1596 1596 } 1597 1597 -
trunk/psLib/src/db/psDB.h
r4612 r5136 10 10 * @author Joshua Hoblitt 11 11 * 12 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-0 7-26 20:00:57$12 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-09-26 21:13:16 $ 14 14 * 15 15 * Copyright 2005 Joshua Hoblitt, University of Hawaii … … 104 104 * type is give by the psMetadataItem.type and psMetadataItem.ptype entries. A 105 105 * lookup table should be used to convert from PSLib types into MySQL 106 * compatible SQL data types. For example, a PS_ META_STRwould map to an SQL99107 * varchar. If the value of type is PS_ META_STRthen the psMetadataItem.data106 * compatible SQL data types. For example, a PS_DATA_STRING would map to an SQL99 107 * varchar. If the value of type is PS_DATA_STRING then the psMetadataItem.data 108 108 * element is set to a string with the length for the field written as a text 109 109 * string. The value of the psMetadataItem.data element is unused for the 110 * PS_META_PRIMITIVE types. Other psMetadata types beyond PS_ META_STRand110 * PS_META_PRIMITIVE types. Other psMetadata types beyond PS_DATA_STRING and 111 111 * PS_META_PRIMITIVE are not allowed in a table definition. 112 112 * … … 170 170 * values, one per row. 171 171 * 172 * Currently, the "where" specification only supports the PS_ META_STRtype.172 * Currently, the "where" specification only supports the PS_DATA_STRING type. 173 173 * The string value can be a SQL match pattern, e.g. "%foo%", or an empty 174 174 * string, e.g. "", to match NULL field values. … … 189 189 * The "row" specification uses the psMetadataItem name as the column name. 190 190 * The field values may be specified in any order. psMetadata types beyond 191 * PS_ META_STRand PS_META_PRIMITIVE are not supported. If fields are191 * PS_DATA_STRING and PS_META_PRIMITIVE are not supported. If fields are 192 192 * specified in "row" that do not exist in "tableName", the insert will fail. 193 193 * -
trunk/psLib/src/fits/psFits.c
r5099 r5136 1 /** @file psFits.c 1 /** @file psFits.cr 2 2 * 3 3 * @brief Contains Fits I/O routines … … 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.4 5$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-09-2 2 23:19:38$9 * @version $Revision: 1.46 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-09-26 21:13:22 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 156 156 } 157 157 158 static bool convertMetadataTypeToBinaryTForm(ps MetadataType type, char** fitsType)158 static bool convertMetadataTypeToBinaryTForm(psDataType type, char** fitsType) 159 159 { 160 160 switch (type) { 161 case PS_ META_BOOL:161 case PS_DATA_BOOL: 162 162 *fitsType = psStringCopy("1L"); 163 163 break; 164 case PS_ META_S32:164 case PS_DATA_S32: 165 165 *fitsType = psStringCopy("1J"); 166 166 break; 167 case PS_ META_F32:167 case PS_DATA_F32: 168 168 *fitsType = psStringCopy("1E"); 169 169 break; 170 case PS_ META_F64:170 case PS_DATA_F64: 171 171 *fitsType = psStringCopy("1D"); 172 172 break; 173 case PS_ META_STR:173 case PS_DATA_STRING: 174 174 *fitsType = psStringCopy("1A"); 175 175 break; … … 510 510 PS_LIST_TAIL, 511 511 keyName, 512 PS_ META_S32 | PS_META_DUPLICATE_OK,512 PS_DATA_S32 | PS_META_DUPLICATE_OK, 513 513 keyComment, 514 514 atoi(keyValue)); … … 520 520 PS_LIST_TAIL, 521 521 keyName, 522 PS_ META_F64 | PS_META_DUPLICATE_OK,522 PS_DATA_F64 | PS_META_DUPLICATE_OK, 523 523 keyComment, 524 524 atof(keyValue)); … … 531 531 PS_LIST_TAIL, 532 532 keyName, 533 PS_ META_STR| PS_META_DUPLICATE_OK,533 PS_DATA_STRING | PS_META_DUPLICATE_OK, 534 534 keyComment, 535 535 keyValue+1); … … 538 538 PS_LIST_TAIL, 539 539 keyName, 540 PS_ META_STR| PS_META_DUPLICATE_OK,540 PS_DATA_STRING | PS_META_DUPLICATE_OK, 541 541 keyComment, 542 542 keyValue); … … 548 548 PS_LIST_TAIL, 549 549 keyName, 550 PS_ META_BOOL | PS_META_DUPLICATE_OK,550 PS_DATA_BOOL | PS_META_DUPLICATE_OK, 551 551 keyComment, 552 552 tempBool); … … 1053 1053 while ( (item=psListGetAndIncrement(iter)) != NULL ) { 1054 1054 switch (item->type) { 1055 case PS_ META_BOOL: {1055 case PS_DATA_BOOL: { 1056 1056 int value = item->data.B; 1057 1057 fits_update_key(fits->fd, … … 1063 1063 break; 1064 1064 } 1065 case PS_ META_S32:1065 case PS_DATA_S32: 1066 1066 fits_update_key(fits->fd, 1067 1067 TINT, … … 1071 1071 &status); 1072 1072 break; 1073 case PS_ META_F32:1073 case PS_DATA_F32: 1074 1074 fits_update_key(fits->fd, 1075 1075 TFLOAT, … … 1079 1079 &status); 1080 1080 break; 1081 case PS_ META_F64:1081 case PS_DATA_F64: 1082 1082 fits_update_key(fits->fd, 1083 1083 TDOUBLE, … … 1087 1087 &status); 1088 1088 break; 1089 case PS_ META_STR:1089 case PS_DATA_STRING: 1090 1090 fits_update_key(fits->fd, 1091 1091 TSTRING, … … 1192 1192 col, name, typecode, repeat, (double)value); \ 1193 1193 psMetadataAdd(data,PS_LIST_TAIL, name, \ 1194 PS_ META_##TYPE, \1194 PS_DATA_##TYPE, \ 1195 1195 "", (ps##TYPE)value); \ 1196 1196 break; \ … … 1214 1214 if (anynul == 0) { 1215 1215 psMetadataAdd(data,PS_LIST_TAIL, name, 1216 PS_ META_STR,1216 PS_DATA_STRING, 1217 1217 "", value); 1218 1218 } … … 1494 1494 PS_LIST_HEAD,true); 1495 1495 while ( (item=psListGetAndIncrement(iter)) != NULL) { 1496 if (PS_ META_IS_PRIMITIVE(item->type) || item->type == PS_META_STR) {1496 if (PS_DATA_IS_PRIMITIVE(item->type) || item->type == PS_DATA_STRING) { 1497 1497 bool found = false; 1498 1498 psMetadataItem* fItem = NULL; … … 1506 1506 if (! found) { 1507 1507 psArrayAdd(columns, columns->nalloc, item); 1508 } else if (item->type == PS_ META_STR&&1508 } else if (item->type == PS_DATA_STRING && 1509 1509 strlen(fItem->data.V) > strlen(item->data.V)) { 1510 1510 // got to keep the longest string value as to know what size to create the table column … … 1567 1567 int row; 1568 1568 item = columns->data[n]; 1569 if (PS_ META_IS_PRIMITIVE(item->type)) {1569 if (PS_DATA_IS_PRIMITIVE(item->type)) { 1570 1570 psVector* col = NULL; 1571 1571 psArray* colArray = NULL; 1572 1572 switch (item->type) { 1573 case PS_ META_S32:1573 case PS_DATA_S32: 1574 1574 col = psVectorAlloc(table->n, PS_TYPE_S32); 1575 1575 for (row = 0; row < table->n; row++) { … … 1587 1587 break; 1588 1588 1589 case PS_ META_F32:1589 case PS_DATA_F32: 1590 1590 col = psVectorAlloc(table->n, PS_TYPE_F32); 1591 1591 for (row = 0; row < table->n; row++) { … … 1603 1603 break; 1604 1604 1605 case PS_ META_F64:1605 case PS_DATA_F64: 1606 1606 col = psVectorAlloc(table->n, PS_TYPE_F64); 1607 1607 for (row = 0; row < table->n; row++) { … … 1619 1619 break; 1620 1620 1621 case PS_ META_BOOL:1621 case PS_DATA_BOOL: 1622 1622 col = psVectorAlloc(table->n, PS_TYPE_BOOL); 1623 1623 for (row = 0; row < table->n; row++) { … … 1635 1635 break; 1636 1636 1637 case PS_ META_STR:1637 case PS_DATA_STRING: 1638 1638 colArray = psArrayAlloc(table->n); 1639 1639 for (row = 0; row < table->n; row++) { … … 1656 1656 } 1657 1657 psFree(col); 1658 } else if (item->type == PS_ META_STR) {1658 } else if (item->type == PS_DATA_STRING) { 1659 1659 psArray* col = psArrayAlloc(table->n); 1660 1660 for (row = 0; row < table->n; row++) { … … 1716 1716 1717 1717 while ( (item=psMetadataGetAndIncrement(iter)) != NULL) { 1718 if (PS_ META_IS_PRIMITIVE(item->type)) {1719 // operating on primitive data type , i.e., not a complex object1718 if (PS_DATA_IS_PRIMITIVE(item->type) || item->type == PS_DATA_STRING) { 1719 // operating on primitive data type or string, i.e., not a complex object 1720 1720 int colnum = 0; 1721 1721 1722 1722 if ( fits_get_colnum(fits->fd, CASESEN, item->name, &colnum, &status) == 0) { 1723 1723 // cooresponding column found in table 1724 int dataType = 0; 1725 convertPsTypeToFits(item->type, NULL, NULL, &dataType); 1724 int dataType = TSTRING; // assume string unless it is a primative type 1725 if (PS_DATA_IS_PRIMITIVE(item->type)) { 1726 convertPsTypeToFits(item->type, NULL, NULL, &dataType); 1727 } 1726 1728 1727 1729 if (fits_write_col(fits->fd, dataType, colnum, row+1, 1, 1, &item->data,&status) != 0) { -
trunk/psLib/src/sys/psType.h
r5057 r5136 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1.4 0$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-09- 15 21:22:22$12 * @version $Revision: 1.41 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-09-26 21:13:25 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 105 105 PS_DATA_ARRAY, ///< psArray 106 106 PS_DATA_BITSET, ///< psBitSet 107 //PS_DATA_CELL, ///< psCell108 //PS_DATA_CHIP, ///< psChip107 PS_DATA_CELL, ///< psCell 108 PS_DATA_CHIP, ///< psChip 109 109 PS_DATA_CUBE, ///< psCube 110 110 PS_DATA_FITS, ///< psFits … … 127 127 PS_DATA_POLYNOMIAL4D, ///< psPolynomial4D 128 128 PS_DATA_PROJECTION, ///< psProjection 129 //PS_DATA_READOUT, ///< psReadout130 //PS_DATA_REGION, ///< psRegion129 PS_DATA_READOUT, ///< psReadout 130 PS_DATA_REGION, ///< psRegion 131 131 PS_DATA_SCALAR, ///< psScalar 132 132 PS_DATA_SPHERE, ///< psSphere -
trunk/psLib/src/types/psMetadata.c
r5089 r5136 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.8 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2005-09-2 2 02:32:00$14 * @version $Revision: 1.85 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-09-26 21:13:26 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 75 75 { 76 76 77 if (existing != NULL && existing->type == PS_ META_MULTI) {77 if (existing != NULL && existing->type == PS_DATA_METADATA_MULTI) { 78 78 return existing; 79 79 } … … 83 83 84 84 psMetadataItem* item = psMetadataItemAlloc(key, 85 PS_ META_MULTI,85 PS_DATA_METADATA_MULTI, 86 86 "", 87 87 newList); … … 113 113 psMemDecrRefCounter(metadataItem->comment); 114 114 115 if(!PS_ META_IS_PRIMITIVE(type)) {115 if(!PS_DATA_IS_PRIMITIVE(type)) { 116 116 psFree(metadataItem->data.V); 117 117 } … … 178 178 } 179 179 180 METADATAITEM_ALLOC_TYPE(Str,const char*,PS_ META_STR)181 METADATAITEM_ALLOC_TYPE(F32,psF32,PS_ META_F32)182 METADATAITEM_ALLOC_TYPE(F64,psF64,PS_ META_F64)183 METADATAITEM_ALLOC_TYPE(S32,psS32,PS_ META_S32)184 METADATAITEM_ALLOC_TYPE(Bool,psBool,PS_ META_BOOL)180 METADATAITEM_ALLOC_TYPE(Str,const char*,PS_DATA_STRING) 181 METADATAITEM_ALLOC_TYPE(F32,psF32,PS_DATA_F32) 182 METADATAITEM_ALLOC_TYPE(F64,psF64,PS_DATA_F64) 183 METADATAITEM_ALLOC_TYPE(S32,psS32,PS_DATA_S32) 184 METADATAITEM_ALLOC_TYPE(Bool,psBool,PS_DATA_BOOL) 185 185 186 186 psMetadataItem* psMetadataItemAllocV(const char *name, … … 217 217 // Allocate and set metadata item name 218 218 metadataItem->name = (char *)psAlloc(sizeof(char) * MAX_STRING_LENGTH); 219 vs printf(metadataItem->name, name, argPtr);219 vsnprintf(metadataItem->name, MAX_STRING_LENGTH, name, argPtr); 220 220 221 221 // Set metadata item value 222 222 switch(metadataItem->type) { 223 case PS_ META_BOOL:223 case PS_DATA_BOOL: 224 224 metadataItem->data.B = (psBool)va_arg(argPtr, psS32); 225 225 break; 226 case PS_ META_S32:226 case PS_DATA_S32: 227 227 metadataItem->data.S32 = (psS32)va_arg(argPtr, psS32); 228 228 break; 229 case PS_ META_F32:229 case PS_DATA_F32: 230 230 metadataItem->data.F32 = (psF32)va_arg(argPtr, psF64); 231 231 break; 232 case PS_ META_F64:232 case PS_DATA_F64: 233 233 metadataItem->data.F64 = (psF64)va_arg(argPtr, psF64); 234 234 break; 235 case PS_ META_STR:235 case PS_DATA_STRING: 236 236 // Perform copy of input strings 237 237 metadataItem->data.V = psStringNCopy(va_arg(argPtr, char *), MAX_STRING_LENGTH); 238 238 break; 239 case PS_META_LIST: 240 case PS_META_VEC: 241 case PS_META_HASH: 242 case PS_META_LOOKUPTABLE: 243 case PS_META_JPEG: 244 case PS_META_PNG: 245 case PS_META_ASTROM: 246 case PS_META_UNKNOWN: 247 case PS_META_META: 248 case PS_META_MULTI: 249 case PS_META_ARRAY: 250 case PS_META_TIME: 239 case PS_DATA_ARRAY: ///< psArray 240 case PS_DATA_BITSET: ///< psBitSet 241 case PS_DATA_CELL: ///< psCell 242 case PS_DATA_CHIP: ///< psChip 243 case PS_DATA_CUBE: ///< psCube 244 case PS_DATA_FITS: ///< psFits 245 case PS_DATA_HASH: ///< psHash 246 case PS_DATA_HISTOGRAM: ///< psHistogram 247 case PS_DATA_IMAGE: ///< psImage 248 case PS_DATA_KERNEL: ///< psKernel 249 case PS_DATA_LIST: ///< psList 250 case PS_DATA_LOOKUPTABLE: ///< psLookupTable 251 case PS_DATA_METADATA: ///< psMetadata 252 case PS_DATA_METADATAITEM: ///< psMetadataItem 253 case PS_DATA_MINIMIZATION: ///< psMinimization 254 case PS_DATA_PIXELS: ///< psPixels 255 case PS_DATA_PLANE: ///< psPlane 256 case PS_DATA_PLANEDISTORT: ///< psPlaneDistort 257 case PS_DATA_PLANETRANSFORM: ///< psPlaneTransform 258 case PS_DATA_POLYNOMIAL1D: ///< psPolynomial1D 259 case PS_DATA_POLYNOMIAL2D: ///< psPolynomial2D 260 case PS_DATA_POLYNOMIAL3D: ///< psPolynomial3D 261 case PS_DATA_POLYNOMIAL4D: ///< psPolynomial4D 262 case PS_DATA_PROJECTION: ///< psProjection 263 case PS_DATA_READOUT: ///< psReadout 264 case PS_DATA_REGION: ///< psRegion 265 case PS_DATA_SCALAR: ///< psScalar 266 case PS_DATA_SPHERE: ///< psSphere 267 case PS_DATA_SPHEREROT: ///< psSphereTransform 268 case PS_DATA_SPLINE1D: ///< psSpline1D 269 case PS_DATA_STATS: ///< psStats 270 case PS_DATA_TIME: ///< psTime 271 case PS_DATA_VECTOR: ///< psVector 272 case PS_DATA_METADATA_MULTI: 251 273 // Copy of input data not performed due to variability of data types 252 274 metadataItem->data.V = psMemIncrRefCounter(va_arg(argPtr, psPtr)); … … 313 335 existingEntry = (psMetadataItem*)psHashLookup(mdTable, key); 314 336 315 if (item->type == PS_ META_MULTI) {316 // the incoming entry is PS_ META_MULTI317 318 // force the hash entry to be PS_ META_MULTI337 if (item->type == PS_DATA_METADATA_MULTI) { 338 // the incoming entry is PS_DATA_METADATA_MULTI 339 340 // force the hash entry to be PS_DATA_METADATA_MULTI 319 341 existingEntry = makeMetaMulti(mdTable,key,existingEntry); 320 342 … … 335 357 // how the item is added to the hash depends on prior existence, flags, etc. 336 358 if(existingEntry != NULL) { // prior existence 337 if (existingEntry->type == PS_ META_MULTI || (flags & PS_META_DUPLICATE_OK) != 0) {359 if (existingEntry->type == PS_DATA_METADATA_MULTI || (flags & PS_META_DUPLICATE_OK) != 0) { 338 360 // duplicate entries allowed - add another entry. 339 361 340 // make sure the existing entry is PS_ META_MULTI362 // make sure the existing entry is PS_DATA_METADATA_MULTI 341 363 existingEntry = makeMetaMulti(mdTable,key,existingEntry); 342 364 … … 429 451 } 430 452 431 METADATA_ADD_TYPE(Bool,psBool,PS_ META_BOOL)432 METADATA_ADD_TYPE(S32,psS32,PS_ META_S32)433 METADATA_ADD_TYPE(F32,psF32,PS_ META_F32)434 METADATA_ADD_TYPE(F64,psF64,PS_ META_F64)435 METADATA_ADD_TYPE(List,psList*,PS_ META_LIST)436 METADATA_ADD_TYPE(Str,const char*,PS_ META_STR)437 METADATA_ADD_TYPE(Vector,psVector*,PS_ META_VEC)438 METADATA_ADD_TYPE(Image,psImage*,PS_ META_IMG)439 METADATA_ADD_TYPE(Hash,psHash*,PS_ META_HASH)440 METADATA_ADD_TYPE(LookupTable,psLookupTable*,PS_ META_LOOKUPTABLE)441 METADATA_ADD_TYPE(Unknown,void*,PS_ META_UNKNOWN)442 METADATA_ADD_TYPE(Metadata,psMetadata*,PS_ META_META)443 METADATA_ADD_TYPE(Array,psArray*,PS_ META_ARRAY)444 METADATA_ADD_TYPE(Time,psTime*,PS_ META_TIME)453 METADATA_ADD_TYPE(Bool,psBool,PS_DATA_BOOL) 454 METADATA_ADD_TYPE(S32,psS32,PS_DATA_S32) 455 METADATA_ADD_TYPE(F32,psF32,PS_DATA_F32) 456 METADATA_ADD_TYPE(F64,psF64,PS_DATA_F64) 457 METADATA_ADD_TYPE(List,psList*,PS_DATA_LIST) 458 METADATA_ADD_TYPE(Str,const char*,PS_DATA_STRING) 459 METADATA_ADD_TYPE(Vector,psVector*,PS_DATA_VECTOR) 460 METADATA_ADD_TYPE(Image,psImage*,PS_DATA_IMAGE) 461 METADATA_ADD_TYPE(Hash,psHash*,PS_DATA_HASH) 462 METADATA_ADD_TYPE(LookupTable,psLookupTable*,PS_DATA_LOOKUPTABLE) 463 METADATA_ADD_TYPE(Unknown,void*,PS_DATA_UNKNOWN) 464 METADATA_ADD_TYPE(Metadata,psMetadata*,PS_DATA_METADATA) 465 METADATA_ADD_TYPE(Array,psArray*,PS_DATA_ARRAY) 466 METADATA_ADD_TYPE(Time,psTime*,PS_DATA_TIME) 445 467 446 468 bool psMetadataRemove(psMetadata *md, … … 464 486 return false; 465 487 } 466 if (entry->type == PS_ META_MULTI) {488 if (entry->type == PS_DATA_METADATA_MULTI) { 467 489 psMetadataItem* listItem; 468 490 psListIterator* iter = psListIteratorAlloc( … … 499 521 } 500 522 501 if (tableItem->type == PS_ META_MULTI) {523 if (tableItem->type == PS_DATA_METADATA_MULTI) { 502 524 // multiple entries with same key, remove just the specified one 503 525 psListRemoveData(tableItem->data.list, entry); … … 548 570 return NULL; 549 571 } 550 if (metadataItem->type == PS_ META_MULTI) {572 if (metadataItem->type == PS_DATA_METADATA_MULTI) { 551 573 // if multiple keys found, use the first. 552 574 metadataItem = (psMetadataItem*)((metadataItem->data.list)->head); 553 575 } 554 576 555 if(PS_ META_IS_PRIMITIVE(metadataItem->type)) {577 if(PS_DATA_IS_PRIMITIVE(metadataItem->type)) { 556 578 if (status) { 557 579 *status = false; … … 583 605 return 0; \ 584 606 } \ 585 if (metadataItem->type == PS_ META_MULTI) { \607 if (metadataItem->type == PS_DATA_METADATA_MULTI) { \ 586 608 /* if multiple keys found, use the first. */ \ 587 609 metadataItem = (psMetadataItem*)((metadataItem->data.list)->head); \ … … 589 611 \ 590 612 switch (metadataItem->type) { \ 591 case PS_ META_S32: \613 case PS_DATA_S32: \ 592 614 value = (ps##TYPE)metadataItem->data.S32; \ 593 615 break; \ 594 case PS_ META_F32: \616 case PS_DATA_F32: \ 595 617 value = (ps##TYPE)metadataItem->data.F32; \ 596 618 break; \ 597 case PS_ META_F64: \619 case PS_DATA_F64: \ 598 620 value = (ps##TYPE)metadataItem->data.F64; \ 599 621 break; \ 600 case PS_ META_BOOL: \622 case PS_DATA_BOOL: \ 601 623 if (metadataItem->data.B) { \ 602 624 value = 1; \ … … 793 815 psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n"); 794 816 } 795 } else if (item->type != PS_ META_META) {817 } else if (item->type != PS_DATA_METADATA) { 796 818 // The value at the key isn't metadata 797 819 if (status) { 798 820 *status = false; 799 821 } else { 800 psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_ META_META, as expected.\n");822 psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_DATA_META, as expected.\n"); 801 823 } 802 824 value = NULL; … … 825 847 psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n"); 826 848 } 827 } else if (item->type != PS_ META_STR) {849 } else if (item->type != PS_DATA_STRING) { 828 850 // The value at the key isn't of the desired type 829 851 if (status) { 830 852 *status = false; 831 853 } else { 832 psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_ META_STR, as expected.\n");854 psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_DATA_STRING, as expected.\n"); 833 855 } 834 856 value = NULL; … … 860 882 printf(": "); 861 883 switch (item->type) { 862 case PS_ META_STR:884 case PS_DATA_STRING: 863 885 printf("%s", (char*)(item->data.V)); 864 886 break; 865 case PS_ META_BOOL:887 case PS_DATA_BOOL: 866 888 if (item->data.B) { 867 889 printf("True"); … … 870 892 } 871 893 break; 872 case PS_ META_S32:894 case PS_DATA_S32: 873 895 printf("%d", item->data.S32); 874 896 break; 875 case PS_ META_F32:897 case PS_DATA_F32: 876 898 printf("%f", item->data.F32); 877 899 break; 878 case PS_ META_F64:900 case PS_DATA_F64: 879 901 printf("%f", item->data.F64); 880 902 break; 881 case PS_ META_META:903 case PS_DATA_METADATA: 882 904 printf("\n"); 883 905 psMetadataPrint(item->data.V, level + 1); … … 981 1003 { 982 1004 // Only doing a representative set of types 983 case PS_ META_S32:1005 case PS_DATA_S32: 984 1006 newItem = psMetadataItemAlloc(item->name, item->type, item->comment, atoi(argv[argnum])); 985 1007 psArgumentRemove(argnum, argc, argv); 986 1008 break; 987 case PS_ META_F32:1009 case PS_DATA_F32: 988 1010 newItem = psMetadataItemAlloc(item->name, item->type, item->comment, atof(argv[argnum])); 989 1011 psArgumentRemove(argnum, argc, argv); 990 1012 break; 991 case PS_ META_BOOL:1013 case PS_DATA_BOOL: 992 1014 // Turn option on; no optional argument to remove 993 1015 newItem = psMetadataItemAlloc(item->name, item->type, item->comment, true); 994 1016 break; 995 1017 // XXX: Include the other numerical types 996 case PS_ META_STR: {1018 case PS_DATA_STRING: { 997 1019 //psString string = psStringCopy(argv[argnum]); // Get the argument into PS memory management 998 1020 //psFree(string); … … 1032 1054 if (argItem) { 1033 1055 psArgumentRemove(i, argc, argv); // Remove the switch 1034 if (argItem->type != PS_ META_MULTI) {1035 if (argItem->type != PS_ META_BOOL && *argc < i + 1) {1056 if (argItem->type != PS_DATA_METADATA_MULTI) { 1057 if (argItem->type != PS_DATA_BOOL && *argc < i + 1) { 1036 1058 psError(PS_ERR_IO, true, "Required argument for %s is missing.\n", argItem->name); 1037 1059 // XXX: Cleanup before returning … … 1100 1122 switch (oldItem->type) { 1101 1123 // Only doing a representative set of types 1102 case PS_ META_S32:1124 case PS_DATA_S32: 1103 1125 oldItem->data.S32 = newItem->data.S32; 1104 1126 break; 1105 case PS_ META_F32:1127 case PS_DATA_F32: 1106 1128 oldItem->data.F32 = newItem->data.F32; 1107 1129 break; 1108 case PS_ META_BOOL:1130 case PS_DATA_BOOL: 1109 1131 oldItem->data.B = newItem->data.B; 1110 1132 break; 1111 1133 // XXX: Include the other numerical types 1112 case PS_ META_STR:1134 case PS_DATA_STRING: 1113 1135 psFree(oldItem->data.V); 1114 1136 oldItem->data.V = psMemIncrRefCounter(newItem->data.V); 1115 1137 break; 1116 case PS_ META_MULTI: {1138 case PS_DATA_METADATA_MULTI: { 1117 1139 psList *newMulti = psMemIncrRefCounter(newItem->data.V); // The new list of MULTI 1118 1140 psList *oldMulti = oldItem->data.V; // The old list of MULTI … … 1128 1150 switch (oldMultiItem->type) { 1129 1151 // Only doing a representative set of types 1130 case PS_ META_S32:1152 case PS_DATA_S32: 1131 1153 oldItem->data.S32 = newItem->data.S32; 1132 1154 break; 1133 case PS_ META_F32:1155 case PS_DATA_F32: 1134 1156 oldItem->data.F32 = newItem->data.F32; 1135 1157 break; 1136 1158 // XXX: Include the other numerical types 1137 case PS_ META_STR:1159 case PS_DATA_STRING: 1138 1160 psFree(oldItem->data.V); 1139 1161 oldItem->data.V = psMemIncrRefCounter(newItem->data.V); … … 1166 1188 switch (arg->type) { 1167 1189 // Only doing a representative set of types 1168 case PS_ META_S32:1190 case PS_DATA_S32: 1169 1191 return arg->data.S32 >= 0 ? (int)log10f((float)arg->data.S32) + 1 : 1170 1192 (int)log10f(-(float)arg->data.S32) + 2; 1171 1193 // XXX: Other numerical types 1172 case PS_ META_F32:1194 case PS_DATA_F32: 1173 1195 return arg->data.F32 >= 0 ? 12 : 13; // -d.dddddde?dd 1174 case PS_ META_F64:1196 case PS_DATA_F64: 1175 1197 return arg->data.F64 >= 0 ? 12 : 13; // -d.dddddde?dd 1176 case PS_ META_BOOL:1198 case PS_DATA_BOOL: 1177 1199 return arg->data.B ? 4 : 5; 1178 case PS_ META_STR:1200 case PS_DATA_STRING: 1179 1201 return strlen(arg->data.V); 1180 1202 default: … … 1231 1253 switch (argItem->type) { 1232 1254 // Only doing a representative set of types 1233 case PS_ META_S32:1255 case PS_DATA_S32: 1234 1256 printf("%d", argItem->data.S32); 1235 1257 break; 1236 1258 // XXX: Other numerical types 1237 case PS_ META_F32:1259 case PS_DATA_F32: 1238 1260 printf("%.6e", argItem->data.F32); 1239 1261 break; 1240 case PS_ META_F64:1262 case PS_DATA_F64: 1241 1263 printf("%.6e", argItem->data.F64); 1242 1264 break; 1243 case PS_ META_BOOL:1265 case PS_DATA_BOOL: 1244 1266 if (argItem->data.B) { 1245 1267 printf("TRUE"); … … 1248 1270 } 1249 1271 break; 1250 case PS_ META_STR:1272 case PS_DATA_STRING: 1251 1273 printf("%s", (char*)(argItem->data.V)); 1252 1274 break; -
trunk/psLib/src/types/psMetadata.h
r5057 r5136 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.6 4$ $Name: not supported by cvs2svn $14 * @date $Date: 2005-09- 15 21:22:22$13 * @version $Revision: 1.65 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2005-09-26 21:13:26 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 32 32 /// @{ 33 33 34 /** Metadata item type. 35 * 36 * Enumeration for maintaining metadata item types. 37 */ 38 typedef enum { 39 PS_META_S32 = PS_TYPE_S32, ///< psS32 primitive data. 40 PS_META_F32 = PS_TYPE_F32, ///< psF32 primitive data. 41 PS_META_F64 = PS_TYPE_F64, ///< psF64 primitive data. 42 PS_META_BOOL = PS_TYPE_BOOL, ///< psBool primitive data. 43 PS_META_LIST = 0x10000, ///< List data (Stored as item.data.list). 44 PS_META_STR, ///< String data (Stored as item.data.V). 45 PS_META_VEC, ///< Vector data (Stored as item.data.V). 46 PS_META_IMG, ///< Image data (Stored as item.data.V). 47 PS_META_HASH, ///< Hash data (Stored as item.data.V). 48 PS_META_LOOKUPTABLE, ///< Lookup table data (Stored as item.data.V). 49 PS_META_JPEG, ///< JPEG data (Stored as item.data.V). 50 PS_META_PNG, ///< PNG data (Stored as item.data.V). 51 PS_META_ASTROM, ///< Astrometric coefficients (Stored as item.data.V). 52 PS_META_UNKNOWN, ///< Other data (Stored as item.data.V). 53 PS_META_MULTI, ///< Used internally, do not create an metadata item of this type. 54 PS_META_META = PS_DATA_METADATA, ///< Metadata data (Stored as item.data.md). 55 PS_META_ARRAY, ///< Array data (Stored as item.data.V). 56 PS_META_TIME ///< psTime data (Stored as item.data.V). 57 } psMetadataType; 58 #define PS_META_IS_PRIMITIVE(TYPE) \ 59 (TYPE == PS_META_S32 || \ 60 TYPE == PS_META_F32 || \ 61 TYPE == PS_META_F64 || \ 62 TYPE == PS_META_BOOL) 63 64 #define PS_META_PRIMITIVE_TYPE(METATYPE) ( \ 65 (METATYPE==PS_META_S32) ? PS_TYPE_S32 : \ 66 (METATYPE==PS_META_F32) ? PS_TYPE_F32 : \ 67 (METATYPE==PS_META_F64) ? PS_TYPE_F64 : \ 68 (METATYPE==PS_META_BOOL) ? PS_TYPE_BOOL : 0 ) 34 #define PS_DATA_IS_PRIMITIVE(TYPE) \ 35 (TYPE == PS_DATA_S32 || \ 36 TYPE == PS_DATA_F32 || \ 37 TYPE == PS_DATA_F64 || \ 38 TYPE == PS_DATA_BOOL) 39 40 #define PS_DATA_PRIMITIVE_TYPE(DATATYPE) ( \ 41 (DATATYPE==PS_DATA_S32 || DATATYPE==PS_DATA_F32 || \ 42 DATATYPE==PS_DATA_F64 || DATATYPE==PS_DATA_BOOL) ? DATATYPE : 0) 43 69 44 70 45 /** Option flags for psMetadata functions -
trunk/psLib/src/types/psMetadataConfig.c
r5103 r5136 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1.4 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-09-2 3 02:39:06 $12 * @version $Revision: 1.46 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-09-26 21:13:26 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 411 411 const psMetadataItem* item) 412 412 { 413 ps MetadataType type;413 psDataType type; 414 414 psBool success = true; 415 415 … … 436 436 #define METADATAITEM_NUMERIC_CAST(FORMAT_TYPE) { \ 437 437 switch(type) { \ 438 case PS_ META_BOOL: \438 case PS_DATA_BOOL: \ 439 439 fprintf(fd, format, (FORMAT_TYPE) item->data.B); \ 440 440 break; \ 441 case PS_ META_S32: \441 case PS_DATA_S32: \ 442 442 fprintf(fd,format,(FORMAT_TYPE) item->data.S32); \ 443 443 break; \ 444 case PS_ META_F32: \444 case PS_DATA_F32: \ 445 445 fprintf(fd, format,(FORMAT_TYPE) item->data.F32); \ 446 446 break; \ 447 case PS_ META_F64: \447 case PS_DATA_F64: \ 448 448 fprintf(fd, format,(FORMAT_TYPE) item->data.F64); \ 449 449 break; \ … … 478 478 break; 479 479 case 's': 480 if (type == PS_ META_STR) {480 if (type == PS_DATA_STRING) { 481 481 fprintf(fd,format,(char*)item->data.V); 482 482 } else { … … 573 573 case 'I': 574 574 success = psMetadataAdd(output, PS_LIST_TAIL, keyName, 575 PS_ META_S32 | PS_META_DUPLICATE_OK,575 PS_DATA_S32 | PS_META_DUPLICATE_OK, 576 576 keyComment, atoi(keyValue)); 577 577 break; 578 578 case 'F': 579 579 success = psMetadataAdd(output, PS_LIST_TAIL, keyName, 580 PS_ META_F64 | PS_META_DUPLICATE_OK,580 PS_DATA_F64 | PS_META_DUPLICATE_OK, 581 581 keyComment, atof(keyValue)); 582 582 break; 583 583 case 'C': 584 584 success = psMetadataAdd(output, PS_LIST_TAIL, keyName, 585 PS_ META_STR| PS_META_DUPLICATE_OK,585 PS_DATA_STRING | PS_META_DUPLICATE_OK, 586 586 keyComment, keyValue); 587 587 break; … … 589 589 tempBool = (keyValue[0] == 'T') ? 1 : 0; 590 590 success = psMetadataAdd(output, PS_LIST_TAIL, keyName, 591 PS_ META_BOOL | PS_META_DUPLICATE_OK,591 PS_DATA_BOOL | PS_META_DUPLICATE_OK, 592 592 keyComment, tempBool); 593 593 break; … … 734 734 psBool returnValue = true; 735 735 psBool addStatus = false; 736 ps MetadataType mdType = PS_META_UNKNOWN;736 psDataType mdType = PS_DATA_UNKNOWN; 737 737 psElemType vectorType = PS_TYPE_S8; 738 738 char* strType = NULL; … … 769 769 // Check if the keyName specifies a vector and if so use strType token to find vector type 770 770 if(*keyName == '@') { 771 mdType = PS_ META_VEC;771 mdType = PS_DATA_VECTOR; 772 772 // Get the type of vector 773 773 if(!strncmp(strType, "U8", 2)) { … … 798 798 } 799 799 } else if(!strncmp(strType, "STR", 3)) { 800 mdType = PS_ META_STR;800 mdType = PS_DATA_STRING; 801 801 } else if(!strncmp(strType, "BOOL", 4)) { 802 mdType = PS_ META_BOOL;802 mdType = PS_DATA_BOOL; 803 803 } else if(!strncmp(strType, "S32", 3)) { 804 mdType = PS_ META_S32;804 mdType = PS_DATA_S32; 805 805 } else if(!strncmp(strType, "F32", 3)) { 806 mdType = PS_ META_F32;806 mdType = PS_DATA_F32; 807 807 } else if(!strncmp(strType, "F64", 3)) { 808 mdType = PS_ META_F64;808 mdType = PS_DATA_F64; 809 809 } else if(!strncmp(strType, "MULTI", 5)) { 810 mdType = PS_ META_MULTI;810 mdType = PS_DATA_METADATA_MULTI; 811 811 } else if(!strncmp(strType, "METADATA", 8)) { 812 mdType = PS_ META_META;812 mdType = PS_DATA_METADATA; 813 813 } else if( !strncmp(strType, "PS_TIME_UTC", 12) || !strncmp(strType, "PS_TIME_TAI", 12) 814 814 || !strncmp(strType, "PS_TIME_UT1", 12) || !strncmp(strType, "PS_TIME_TT", 12)) { 815 mdType = PS_ META_TIME;815 mdType = PS_DATA_TIME; 816 816 } else { 817 817 // Search through user types … … 824 824 // Add metadata item 825 825 md = ((p_psParseLevelInfo*)(levelArray->data[*level]))->metadata; 826 addStatus = psMetadataAdd(md,PS_LIST_TAIL,keyName,PS_ META_META | flags,"",tempMeta);826 addStatus = psMetadataAdd(md,PS_LIST_TAIL,keyName,PS_DATA_METADATA | flags,"",tempMeta); 827 827 // Check for add failure 828 828 if (! addStatus) { … … 858 858 859 859 // If type is not MULTI or META then get the value and comment 860 if((mdType != PS_ META_MULTI) && (mdType != PS_META_META)) {860 if((mdType != PS_DATA_METADATA_MULTI) && (mdType != PS_DATA_METADATA)) { 861 861 // Get the metadata item value if there is one. 862 862 status = 0; … … 893 893 nonUniqueKeys = ((p_psParseLevelInfo*)(levelArray->data[*level]))->nonUniqueKeyArray; 894 894 switch(mdType) { 895 case PS_ META_STR:895 case PS_DATA_STRING: 896 896 addStatus = psMetadataAdd(md, PS_LIST_TAIL, keyName, 897 897 mdType | flags, 898 898 strComment, strValue); 899 899 break; 900 case PS_ META_BOOL:900 case PS_DATA_BOOL: 901 901 tempBool = parseBool(strValue, &status); 902 902 if(!status) { … … 910 910 } 911 911 break; 912 case PS_ META_F32:913 case PS_ META_F64:912 case PS_DATA_F32: 913 case PS_DATA_F64: 914 914 tempDbl = parseValue(strValue, &status); 915 915 if(!status) { … … 924 924 } 925 925 break; 926 case PS_ META_S32:926 case PS_DATA_S32: 927 927 tempInt = (psS32)parseValue(strValue, &status); 928 928 if(!status) { … … 936 936 } 937 937 break; 938 case PS_ META_TIME:938 case PS_DATA_TIME: 939 939 if( !strncmp(strType, "PS_TIME_UTC", 12) ) 940 940 timeType = PS_TIME_UTC; … … 957 957 psFree(mTime); 958 958 break; 959 case PS_ META_VEC:959 case PS_DATA_VECTOR: 960 960 tempVec = parseVector(strValue, vectorType, &status); 961 961 if(!status) { … … 970 970 psFree(tempVec); 971 971 break; 972 case PS_ META_MULTI:972 case PS_DATA_METADATA_MULTI: 973 973 // Add key to non-unique array of keys 974 974 // Check for duplicate MULTI lines … … 987 987 psFree(tempStr); 988 988 break; 989 case PS_ META_META:989 case PS_DATA_METADATA: 990 990 // Create next level info 991 991 nextLevelInfo = p_psParseLevelInfoAlloc(); … … 1120 1120 addStatus = psMetadataAdd(upperLevelInfo->metadata, 1121 1121 PS_LIST_TAIL,lowerLevelInfo->name, 1122 PS_ META_META | flags,1122 PS_DATA_METADATA | flags, 1123 1123 "", 1124 1124 lowerLevelInfo->metadata); … … 1242 1242 while ( (item = psMetadataGetAndIncrement(iter)) ) { 1243 1243 type = item->type; 1244 if ( type == PS_ META_STR)1244 if ( type == PS_DATA_STRING) 1245 1245 type = PS_DATA_STRING; 1246 if ( type == PS_ META_VEC)1246 if ( type == PS_DATA_VECTOR) 1247 1247 type = PS_DATA_VECTOR; 1248 if ( type == PS_ META_TIME)1248 if ( type == PS_DATA_TIME) 1249 1249 type = PS_DATA_TIME; 1250 if ( item->type == PS_ META_META)1250 if ( item->type == PS_DATA_METADATA) 1251 1251 type = PS_DATA_METADATA; 1252 1252 -
trunk/psLib/src/xml/psXML.c
r5057 r5136 10 10 * @author David Robbins, MHPCC 11 11 * 12 * @version $Revision: 1.4 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-09- 15 21:22:22$12 * @version $Revision: 1.43 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-09-26 21:13:28 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 68 68 while ( item != NULL ) { 69 69 type = item->type; 70 if ( type == PS_META_STR)71 type = PS_DATA_STRING;72 if ( type == PS_META_VEC)73 type = PS_DATA_VECTOR;74 if ( type == PS_META_TIME)75 type = PS_DATA_TIME;76 70 switch (type) { 77 71 case PS_DATA_BOOL: -
trunk/psLib/test/db/tst_psDB.c
r4558 r5136 9 9 * @author Aaron Culliney, MHPCC 10 10 * 11 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $12 * @date $Date: 2005-0 7-15 02:40:20$11 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2005-09-26 21:13:29 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1612 1612 switch(itemNum) { 1613 1613 case 0: 1614 if(mdItem->type != PS_ META_VEC) {1614 if(mdItem->type != PS_DATA_VECTOR) { 1615 1615 psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d", 1616 itemNum,mdItem->type,PS_ META_VEC);1616 itemNum,mdItem->type,PS_DATA_VECTOR); 1617 1617 psDBDropTable(dbh,table); 1618 1618 psDBCleanup(dbh); … … 1642 1642 break; 1643 1643 case 1: 1644 if(mdItem->type != PS_ META_VEC) {1644 if(mdItem->type != PS_DATA_VECTOR) { 1645 1645 psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d", 1646 itemNum,mdItem->type,PS_ META_VEC);1646 itemNum,mdItem->type,PS_DATA_VECTOR); 1647 1647 psDBDropTable(dbh,table); 1648 1648 psDBCleanup(dbh); … … 1672 1672 break; 1673 1673 case 2: 1674 if(mdItem->type != PS_ META_VEC) {1674 if(mdItem->type != PS_DATA_VECTOR) { 1675 1675 psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d", 1676 itemNum,mdItem->type,PS_ META_VEC);1676 itemNum,mdItem->type,PS_DATA_VECTOR); 1677 1677 psDBDropTable(dbh,table); 1678 1678 psDBCleanup(dbh); … … 1702 1702 break; 1703 1703 case 3: 1704 if(mdItem->type != PS_ META_VEC) {1704 if(mdItem->type != PS_DATA_VECTOR) { 1705 1705 psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d", 1706 itemNum,mdItem->type,PS_ META_VEC);1706 itemNum,mdItem->type,PS_DATA_VECTOR); 1707 1707 psDBDropTable(dbh,table); 1708 1708 psDBCleanup(dbh); … … 1732 1732 break; 1733 1733 case 4: 1734 if(mdItem->type != PS_ META_VEC) {1734 if(mdItem->type != PS_DATA_VECTOR) { 1735 1735 psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d", 1736 itemNum,mdItem->type,PS_ META_VEC);1736 itemNum,mdItem->type,PS_DATA_VECTOR); 1737 1737 psDBDropTable(dbh,table); 1738 1738 psDBCleanup(dbh); … … 1762 1762 break; 1763 1763 case 5: 1764 if(mdItem->type != PS_ META_ARRAY) {1764 if(mdItem->type != PS_DATA_ARRAY) { 1765 1765 psError(PS_ERR_UNKNOWN,true,"Column #%d type %d not as expected %d", 1766 itemNum,mdItem->type,PS_ META_ARRAY);1766 itemNum,mdItem->type,PS_DATA_ARRAY); 1767 1767 psDBDropTable(dbh,table); 1768 1768 psDBCleanup(dbh); -
trunk/psLib/test/fits/tst_psFits.c
r4891 r5136 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-0 8-27 01:33:41$8 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-09-26 21:13:30 $ 10 10 * 11 11 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 101 101 102 102 psMetadataAdd(header,PS_LIST_TAIL, "MYINT", 103 PS_ META_S32,103 PS_DATA_S32, 104 104 "psS32 Item", (psS32)lcv); 105 105 106 106 psMetadataAdd(header,PS_LIST_TAIL, "MYFLT", 107 PS_ META_F32,107 PS_DATA_F32, 108 108 "psF32 Item", (float)(1.0f/(float)(1+lcv))); 109 109 110 110 psMetadataAdd(header,PS_LIST_TAIL, "MYDBL", 111 PS_ META_F64,111 PS_DATA_F64, 112 112 "psF64 Item", (double)(1.0/(double)(1+lcv))); 113 113 114 114 psMetadataAdd(header,PS_LIST_TAIL, "MYBOOL", 115 PS_ META_BOOL,115 PS_DATA_BOOL, 116 116 "psBool Item", 117 117 (lcv%2 == 0)); 118 118 119 119 psMetadataAdd(header,PS_LIST_TAIL, "MYSTR", 120 PS_ META_STR,120 PS_DATA_STRING, 121 121 "String Item", 122 122 extname); 123 123 124 124 psMetadataAdd(header,PS_LIST_TAIL, "EXTNAME", 125 PS_ META_STR,125 PS_DATA_STRING, 126 126 "Extension Name", 127 127 extname); … … 175 175 176 176 psMetadataAdd(header,PS_LIST_TAIL, "MYINT", 177 PS_ META_S32,177 PS_DATA_S32, 178 178 "psS32 Item", 179 179 (psS32)row); 180 180 181 181 psMetadataAdd(header,PS_LIST_TAIL, "MYFLT", 182 PS_ META_F32,182 PS_DATA_F32, 183 183 "psF32 Item", 184 184 (float)(1.0f/(float)(1+row))); 185 185 186 186 psMetadataAdd(header,PS_LIST_TAIL, "MYDBL", 187 PS_ META_F64,187 PS_DATA_F64, 188 188 "psF64 Item", 189 189 (double)(1.0/(double)(1+row))); 190 190 191 191 psMetadataAdd(header,PS_LIST_TAIL, "MYBOOL", 192 PS_ META_BOOL,192 PS_DATA_BOOL, 193 193 "psBool Item", 194 194 (row%2 == 0)); 195 196 char* str = NULL; 197 psStringAppend(&str,"row=%d",row); 198 psMetadataAdd(header,PS_LIST_TAIL, "MYSTR", 199 PS_DATA_STRING, 200 "psString Item", 201 str); 195 202 196 203 table->data[row] = header; … … 685 692 686 693 if (boolItem == NULL || 687 boolItem->type != PS_ META_BOOL) {694 boolItem->type != PS_DATA_BOOL) { 688 695 psError(PS_ERR_UNKNOWN, true, 689 696 "Failed to retrieve psBool metadata item from file."); -
trunk/psLib/test/types/tst_psMetadataIO.c
r4891 r5136 13 13 * @author Eric Van Alst, MHPCC 14 14 * 15 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $16 * @date $Date: 2005-0 8-27 01:33:41$15 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2005-09-26 21:13:33 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 88 88 "","","","A number","" 89 89 }; 90 const ps MetadataType testConfig1TypeOverwrite[] =91 { 92 PS_ META_F64, PS_META_STR, PS_META_BOOL, PS_META_VEC, PS_META_STR,93 PS_ META_STR, PS_META_STR, PS_META_STR, PS_META_STR, PS_META_F64,94 PS_ META_BOOL, PS_META_VEC, PS_META_VEC, PS_META_VEC, PS_META_VEC,95 PS_ META_VEC, PS_META_VEC, PS_META_VEC, PS_META_VEC, PS_META_VEC,96 PS_ META_META, PS_META_META, PS_META_META, PS_META_S32, PS_META_META90 const psDataType testConfig1TypeOverwrite[] = 91 { 92 PS_DATA_F64, PS_DATA_STRING, PS_DATA_BOOL, PS_DATA_VECTOR, PS_DATA_STRING, 93 PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING, PS_DATA_F64, 94 PS_DATA_BOOL, PS_DATA_VECTOR, PS_DATA_VECTOR, PS_DATA_VECTOR, PS_DATA_VECTOR, 95 PS_DATA_VECTOR, PS_DATA_VECTOR, PS_DATA_VECTOR, PS_DATA_VECTOR, PS_DATA_VECTOR, 96 PS_DATA_METADATA, PS_DATA_METADATA, PS_DATA_METADATA, PS_DATA_S32, PS_DATA_METADATA 97 97 }; 98 98 const psS32 testConfig1ValueS32Overwrite[] = … … 201 201 "EXTNAME","BIASSEC","CHIP" 202 202 }; 203 const ps MetadataType testConfig1ValueMetaTypes1[] =204 { 205 PS_ META_STR, PS_META_STR, PS_META_STR203 const psDataType testConfig1ValueMetaTypes1[] = 204 { 205 PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING 206 206 }; 207 207 const char* testConfig1ValueMetaValue1[] = … … 214 214 "EXTNAME","BIASSEC","CHIP" 215 215 }; 216 const ps MetadataType testConfig1ValueMetaTypes2[] =217 { 218 PS_ META_STR, PS_META_STR, PS_META_STR216 const psDataType testConfig1ValueMetaTypes2[] = 217 { 218 PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING 219 219 }; 220 220 const char* testConfig1ValueMetaValue2[] = … … 227 227 "EXTNAME","BIASSEC","CHIP","NCELL" 228 228 }; 229 const ps MetadataType testConfig1ValueMetaTypes3[] =230 { 231 PS_ META_STR, PS_META_STR, PS_META_STR, PS_META_S32229 const psDataType testConfig1ValueMetaTypes3[] = 230 { 231 PS_DATA_STRING, PS_DATA_STRING, PS_DATA_STRING, PS_DATA_S32 232 232 }; 233 233 const char* testConfig1ValueMetaValueStr3[] = … … 383 383 384 384 switch(metadataItem->type) { 385 case PS_ META_BOOL:385 case PS_DATA_BOOL: 386 386 printf("%s%-25s BOOL %40d",indentStr,metadataItem->name,metadataItem->data.B); 387 387 break; 388 case PS_ META_S32:388 case PS_DATA_S32: 389 389 printf("%s%-25s S32 %40d",indentStr,metadataItem->name,metadataItem->data.S32); 390 390 break; 391 case PS_ META_F32:391 case PS_DATA_F32: 392 392 printf("%s%-25s F32 %40f",indentStr,metadataItem->name,metadataItem->data.F32); 393 393 break; 394 case PS_ META_F64:394 case PS_DATA_F64: 395 395 printf("%s%-25s F64 %40lf",indentStr,metadataItem->name,metadataItem->data.F64); 396 396 break; 397 case PS_ META_VEC:397 case PS_DATA_VECTOR: 398 398 vecStr = (char*)vectorToConfigString((psVector*)metadataItem->data.V); 399 399 printf("%s@%-24s %s",indentStr,metadataItem->name,vecStr); 400 400 psFree(vecStr); 401 401 break; 402 case PS_ META_STR:402 case PS_DATA_STRING: 403 403 printf("%s%-25s STR %40s",indentStr,metadataItem->name,(char*)metadataItem->data.V); 404 404 break; 405 case PS_ META_META:405 case PS_DATA_METADATA: 406 406 printf("%s%-25s METADATA\n",indentStr,metadataItem->name); 407 407 char nestedStr[256] = " "; … … 545 545 // Compare values 546 546 switch(entryChild->type) { 547 case PS_ META_S32:547 case PS_DATA_S32: 548 548 if(entryChild->data.S32 != testConfig1ValueS32Overwrite[i]) { 549 549 psError(PS_ERR_UNKNOWN,true,"File: %s : Value %d not as expected %d", … … 552 552 } 553 553 break; 554 case PS_ META_F32:554 case PS_DATA_F32: 555 555 if(fabs(entryChild->data.F32 - testConfig1ValueF32Overwrite[i]) > ERROR_TOL) { 556 556 psError(PS_ERR_UNKNOWN,true,"File: %s : Value %f not as expected %f", … … 559 559 } 560 560 break; 561 case PS_ META_F64:561 case PS_DATA_F64: 562 562 if(fabs(entryChild->data.F64 - testConfig1ValueF64Overwrite[i]) > ERROR_TOL) { 563 563 psError(PS_ERR_UNKNOWN,true,"File: %s : Value %lf not as expected %lf", … … 566 566 } 567 567 break; 568 case PS_ META_BOOL:568 case PS_DATA_BOOL: 569 569 if(entryChild->data.B != testConfig1ValueBoolOverwrite[i]) { 570 570 psError(PS_ERR_UNKNOWN,true,"File: %s : Value %d not as expected %d", … … 573 573 } 574 574 break; 575 case PS_ META_STR:575 case PS_DATA_STRING: 576 576 if(strcmp(entryChild->data.V,testConfig1ValueStrOverwrite[i]) != 0) { 577 577 psError(PS_ERR_UNKNOWN,true,"File: %s : Value %s not as expected %s", … … 580 580 } 581 581 break; 582 case PS_ META_VEC:582 case PS_DATA_VECTOR: 583 583 // Verify the correct number of entries 584 584 switch(((psVector*)(entryChild->data.V))->type.type) { … … 809 809 } 810 810 break; 811 case PS_ META_META:811 case PS_DATA_METADATA: 812 812 if(metaCounter == 0) { 813 813 // Check if number of items is as expected … … 890 890 } 891 891 switch(mdChild->type) { 892 case PS_ META_STR:892 case PS_DATA_STRING: 893 893 if(strcmp((char*)mdChild->data.V,testConfig1ValueMetaValueStr3[mdCounter]) != 0) { 894 894 psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 3 value[%d] %s not as expected %s", … … 898 898 } 899 899 break; 900 case PS_ META_S32:900 case PS_DATA_S32: 901 901 if(mdChild->data.S32 != testConfig1ValueMetaValueS323[mdCounter]) { 902 902 psError(PS_ERR_UNKNOWN,true,"File: %s : Metadata 3 value[%d] %d not as expected %d", -
trunk/psLib/test/types/tst_psMetadata_01.c
r4590 r5136 18 18 * @author Ross Harman, MHPCC 19 19 * 20 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $21 * @date $Date: 2005-0 7-21 02:39:57$20 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 21 * @date $Date: 2005-09-26 21:13:33 $ 22 22 * 23 23 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 75 75 76 76 switch (metadataItem->type) { 77 case PS_ META_MULTI:77 case PS_DATA_METADATA_MULTI: 78 78 printf("Key Value: %17c", ' '); 79 79 break; 80 case PS_ META_BOOL:80 case PS_DATA_BOOL: 81 81 printf("Key Value: %15d ", metadataItem->data.B); 82 82 break; 83 case PS_ META_S32:83 case PS_DATA_S32: 84 84 printf("Key Value: %15d ", metadataItem->data.S32); 85 85 break; 86 case PS_ META_F32:86 case PS_DATA_F32: 87 87 printf("Key Value: %15.3f ", metadataItem->data.F32); 88 88 break; 89 case PS_ META_F64:89 case PS_DATA_F64: 90 90 printf("Key Value: %15.3f ", metadataItem->data.F64); 91 91 break; 92 case PS_ META_STR:92 case PS_DATA_STRING: 93 93 printf("Key Value: %15s ", (char*)metadataItem->data.V); 94 94 break; … … 98 98 printf("Key Comment: %s\n", metadataItem->comment); 99 99 100 if(metadataItem->data.V && metadataItem->type==PS_ META_MULTI) {100 if(metadataItem->data.V && metadataItem->type==PS_DATA_METADATA_MULTI) { 101 101 printMetadataList(metadataItem->data.V, " "); 102 102 } -
trunk/psLib/test/types/tst_psMetadata_02.c
r4547 r5136 15 15 * @author Robert DeSonia, MHPCC 16 16 * 17 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $18 * @date $Date: 2005-0 7-13 02:47:01$17 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 18 * @date $Date: 2005-09-26 21:13:33 $ 19 19 * 20 20 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 32 32 33 33 switch (metadataItem->type) { 34 case PS_ META_MULTI:34 case PS_DATA_METADATA_MULTI: 35 35 printf("Key Value: %17c", ' '); 36 36 break; 37 case PS_ META_BOOL:37 case PS_DATA_BOOL: 38 38 printf("Key Value: %15d ", metadataItem->data.B); 39 39 break; 40 case PS_ META_S32:40 case PS_DATA_S32: 41 41 printf("Key Value: %15d ", metadataItem->data.S32); 42 42 break; 43 case PS_ META_F32:43 case PS_DATA_F32: 44 44 printf("Key Value: %15.3f ", metadataItem->data.F32); 45 45 break; 46 case PS_ META_F64:46 case PS_DATA_F64: 47 47 printf("Key Value: %15.3f ", metadataItem->data.F64); 48 48 break; 49 case PS_ META_STR:49 case PS_DATA_STRING: 50 50 printf("Key Value: %15s ", (char*)metadataItem->data.V); 51 51 break; … … 70 70 // Test A - Allocate metadata items 71 71 printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items"); 72 item1 = psMetadataItemAlloc("myItem1", PS_ META_BOOL, "I am a boolean", true);73 item2 = psMetadataItemAlloc("myItem2", PS_ META_S32, "I am a signed integer", 111);74 item3 = psMetadataItemAlloc("myItem3", PS_ META_F32, "I am a single precision floating point", 222.222);75 item4 = psMetadataItemAlloc("myItem4", PS_ META_F64, "I am a double precision floating point", 333.333);76 item5 = psMetadataItemAlloc("myItem5", PS_ META_STR, "I am a string", "HELLO WORLD");72 item1 = psMetadataItemAlloc("myItem1", PS_DATA_BOOL, "I am a boolean", true); 73 item2 = psMetadataItemAlloc("myItem2", PS_DATA_S32, "I am a signed integer", 111); 74 item3 = psMetadataItemAlloc("myItem3", PS_DATA_F32, "I am a single precision floating point", 222.222); 75 item4 = psMetadataItemAlloc("myItem4", PS_DATA_F64, "I am a double precision floating point", 333.333); 76 item5 = psMetadataItemAlloc("myItem5", PS_DATA_STRING, "I am a string", "HELLO WORLD"); 77 77 printMetadataItem(item1); 78 78 printMetadataItem(item2); … … 87 87 "Null value for name not allowed", 0); 88 88 psLogMsg(__func__,PS_LOG_INFO,"Following should produce error for null name."); 89 badItem = psMetadataItemAlloc(NULL, PS_ META_STR, "I am a string", "HELLO WORLD");89 badItem = psMetadataItemAlloc(NULL, PS_DATA_STRING, "I am a string", "HELLO WORLD"); 90 90 if (badItem != NULL) { 91 91 psError(PS_ERR_UNKNOWN, true,"psMetadataItemAlloc did not return null with null name item."); … … 97 97 // Test C - Attempt to create metadata item with invalid type 98 98 printNegativeTestHeader(stdout,"psMetadata", "Test C - Attempt to create metadata item with invalid type", 99 "Invalid ps MetadataType: 6", 0);99 "Invalid psDataType: 6", 0); 100 100 badItem = psMetadataItemAlloc("badItem", -1, "I am bad", "Bad comment"); 101 101 printFooter(stdout, "psMetadata", "Test C - Attempt to create metadata item with invalid type", true); -
trunk/psLib/test/types/tst_psMetadata_03.c
r4590 r5136 18 18 * @author Ross Harman, MHPCC 19 19 * 20 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $21 * @date $Date: 2005-0 7-21 02:39:57$20 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 21 * @date $Date: 2005-09-26 21:13:33 $ 22 22 * 23 23 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 35 35 36 36 switch (metadataItem->type) { 37 case PS_ META_MULTI:37 case PS_DATA_METADATA_MULTI: 38 38 printf("Key Value: %17c", ' '); 39 39 break; 40 case PS_ META_BOOL:40 case PS_DATA_BOOL: 41 41 printf("Key Value: %15d ", metadataItem->data.B); 42 42 break; 43 case PS_ META_S32:43 case PS_DATA_S32: 44 44 printf("Key Value: %15d ", metadataItem->data.S32); 45 45 break; 46 case PS_ META_F32:46 case PS_DATA_F32: 47 47 printf("Key Value: %15.3f ", metadataItem->data.F32); 48 48 break; 49 case PS_ META_F64:49 case PS_DATA_F64: 50 50 printf("Key Value: %15.3f ", metadataItem->data.F64); 51 51 break; 52 case PS_ META_STR:52 case PS_DATA_STRING: 53 53 printf("Key Value: %15s ", (char*)metadataItem->data.V); 54 54 break; … … 76 76 printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items"); 77 77 metadata = psMetadataAlloc(); 78 item1 = psMetadataItemAlloc("myItem1", PS_ META_BOOL, "I am a boolean", true);79 item2 = psMetadataItemAlloc("myItem2", PS_ META_S32, "I am a integer", 55);80 item3 = psMetadataItemAlloc("myItem3", PS_ META_BOOL, "I am a boolean", false);81 item4 = psMetadataItemAlloc("myItem4", PS_ META_S32, "I am a integer", 66);82 errItem = psMetadataItemAlloc("errItem", PS_ META_S32, "I am a integer", 99);78 item1 = psMetadataItemAlloc("myItem1", PS_DATA_BOOL, "I am a boolean", true); 79 item2 = psMetadataItemAlloc("myItem2", PS_DATA_S32, "I am a integer", 55); 80 item3 = psMetadataItemAlloc("myItem3", PS_DATA_BOOL, "I am a boolean", false); 81 item4 = psMetadataItemAlloc("myItem4", PS_DATA_S32, "I am a integer", 66); 82 errItem = psMetadataItemAlloc("errItem", PS_DATA_S32, "I am a integer", 99); 83 83 printMetadataItem(item1); 84 84 printMetadataItem(item2); … … 94 94 return 10; 95 95 } 96 if(!psMetadataAdd(metadata,PS_LIST_HEAD,"myItem2", PS_ META_S32, "I am S32 integer",77)) {96 if(!psMetadataAdd(metadata,PS_LIST_HEAD,"myItem2", PS_DATA_S32, "I am S32 integer",77)) { 97 97 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by name."); 98 98 return 11; … … 115 115 return 14; 116 116 } 117 if ( ! psMetadataAdd(metadata,PS_LIST_HEAD,"myItem4", PS_ META_S32, "I am S32 integer",88) ) {117 if ( ! psMetadataAdd(metadata,PS_LIST_HEAD,"myItem4", PS_DATA_S32, "I am S32 integer",88) ) { 118 118 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by index."); 119 119 return 15; … … 210 210 mdTable = errMetadata->hash; 211 211 errMetadata->hash = NULL; 212 if (psMetadataAdd(errMetadata, PS_LIST_HEAD, "errItem", PS_ META_S32, "Integer",22) ) {212 if (psMetadataAdd(errMetadata, PS_LIST_HEAD, "errItem", PS_DATA_S32, "Integer",22) ) { 213 213 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return false w/ invalid metadata struct w/o hash table."); 214 214 return 24; -
trunk/psLib/test/types/tst_psMetadata_04.c
r5057 r5136 25 25 * @author Ross Harman, MHPCC 26 26 * 27 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $28 * @date $Date: 2005-09- 15 21:22:22$27 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 28 * @date $Date: 2005-09-26 21:13:33 $ 29 29 * 30 30 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 42 42 43 43 switch (metadataItem->type) { 44 case PS_ META_MULTI:44 case PS_DATA_METADATA_MULTI: 45 45 printf("Key Value: %17c", ' '); 46 46 break; 47 case PS_ META_BOOL:47 case PS_DATA_BOOL: 48 48 printf("Key Value: %15d ", metadataItem->data.B); 49 49 break; 50 case PS_ META_S32:50 case PS_DATA_S32: 51 51 printf("Key Value: %15d ", metadataItem->data.S32); 52 52 break; 53 case PS_ META_F32:53 case PS_DATA_F32: 54 54 printf("Key Value: %15.3f ", metadataItem->data.F32); 55 55 break; 56 case PS_ META_F64:56 case PS_DATA_F64: 57 57 printf("Key Value: %15.3f ", metadataItem->data.F64); 58 58 break; 59 case PS_ META_STR:59 case PS_DATA_STRING: 60 60 printf("Key Value: %15s ", (char*)metadataItem->data.V); 61 61 break; … … 93 93 strncpy(string, "String was here", 50); 94 94 psMetadataAddF64(newMD, PS_LIST_HEAD, "yourItem1", 0, "I am a psF64", 4.14); 95 item1 = psMetadataItemAlloc("myItem1", PS_ META_BOOL, "I am a boolean", true);96 item2 = psMetadataItemAlloc("myItem2", PS_ META_S32, "I am a integer", 55);97 item3 = psMetadataItemAlloc("myItem3", PS_ META_BOOL, "I am a boolean", false);98 item4 = psMetadataItemAlloc("myItem4", PS_ META_S32, "I am a integer", 66);99 item5 = psMetadataItemAlloc("myItem5", PS_ META_F64, "I am a double", 3.14);100 item6 = psMetadataItemAlloc("myItem6", PS_ META_VEC, "I am a vector", vec);101 item7 = psMetadataItemAlloc("myItem7", PS_ META_META, "I am a metadata", newMD);102 item8 = psMetadataItemAlloc("myItem8", PS_ META_STR, "I am a string", string);95 item1 = psMetadataItemAlloc("myItem1", PS_DATA_BOOL, "I am a boolean", true); 96 item2 = psMetadataItemAlloc("myItem2", PS_DATA_S32, "I am a integer", 55); 97 item3 = psMetadataItemAlloc("myItem3", PS_DATA_BOOL, "I am a boolean", false); 98 item4 = psMetadataItemAlloc("myItem4", PS_DATA_S32, "I am a integer", 66); 99 item5 = psMetadataItemAlloc("myItem5", PS_DATA_F64, "I am a double", 3.14); 100 item6 = psMetadataItemAlloc("myItem6", PS_DATA_VECTOR, "I am a vector", vec); 101 item7 = psMetadataItemAlloc("myItem7", PS_DATA_METADATA, "I am a metadata", newMD); 102 item8 = psMetadataItemAlloc("myItem8", PS_DATA_STRING, "I am a string", string); 103 103 printMetadataItem(item1); 104 104 printMetadataItem(item2); -
trunk/psLib/test/types/tst_psMetadata_05.c
r4547 r5136 22 22 * @author Ross Harman, MHPCC 23 23 * 24 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $25 * @date $Date: 2005-0 7-13 02:47:01$24 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 25 * @date $Date: 2005-09-26 21:13:33 $ 26 26 * 27 27 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 39 39 40 40 switch (metadataItem->type) { 41 case PS_ META_MULTI:41 case PS_DATA_METADATA_MULTI: 42 42 printf("Key Value: %17c", ' '); 43 43 break; 44 case PS_ META_BOOL:44 case PS_DATA_BOOL: 45 45 printf("Key Value: %15d ", metadataItem->data.B); 46 46 break; 47 case PS_ META_S32:47 case PS_DATA_S32: 48 48 printf("Key Value: %15d ", metadataItem->data.S32); 49 49 break; 50 case PS_ META_F32:50 case PS_DATA_F32: 51 51 printf("Key Value: %15.3f ", metadataItem->data.F32); 52 52 break; 53 case PS_ META_F64:53 case PS_DATA_F64: 54 54 printf("Key Value: %15.3f ", metadataItem->data.F64); 55 55 break; 56 case PS_ META_STR:56 case PS_DATA_STRING: 57 57 printf("Key Value: %15s ", (char*)metadataItem->data.V); 58 58 break; … … 80 80 printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items"); 81 81 metadata = psMetadataAlloc(); 82 item1 = psMetadataItemAlloc("myItem1", PS_ META_BOOL, "I am a boolean", true);83 item2 = psMetadataItemAlloc("myItem2", PS_ META_S32, "I am a integer", 55);84 item3 = psMetadataItemAlloc("myItem3", PS_ META_BOOL, "I am a boolean", false);85 item4 = psMetadataItemAlloc("myItem4", PS_ META_S32, "I am a integer", 66);86 item5 = psMetadataItemAlloc("myItem5", PS_ META_F32, "I am a float", 3.14);87 item6 = psMetadataItemAlloc("myItem6", PS_ META_F64,"I am a double", 6.28);88 item7 = psMetadataItemAlloc("myItem7", PS_ META_STR, "I am a string", "GNIRTS");82 item1 = psMetadataItemAlloc("myItem1", PS_DATA_BOOL, "I am a boolean", true); 83 item2 = psMetadataItemAlloc("myItem2", PS_DATA_S32, "I am a integer", 55); 84 item3 = psMetadataItemAlloc("myItem3", PS_DATA_BOOL, "I am a boolean", false); 85 item4 = psMetadataItemAlloc("myItem4", PS_DATA_S32, "I am a integer", 66); 86 item5 = psMetadataItemAlloc("myItem5", PS_DATA_F32, "I am a float", 3.14); 87 item6 = psMetadataItemAlloc("myItem6", PS_DATA_F64,"I am a double", 6.28); 88 item7 = psMetadataItemAlloc("myItem7", PS_DATA_STRING, "I am a string", "GNIRTS"); 89 89 // item8 = psMetadataItemAlloc("myItem8", PS_TYPE_PTR, PS_META_UNKNOWN, "I am unknown"); 90 90 printMetadataItem(item1); -
trunk/psLib/test/types/tst_psMetadata_06.c
r4547 r5136 13 13 * @author Ross Harman, MHPCC 14 14 * 15 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $16 * @date $Date: 2005-0 7-13 02:47:01$15 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2005-09-26 21:13:33 $ 17 17 * 18 18 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 30 30 31 31 switch (metadataItem->type) { 32 case PS_ META_MULTI:32 case PS_DATA_METADATA_MULTI: 33 33 printf("Key Value: %17c", ' '); 34 34 break; 35 case PS_ META_LIST:35 case PS_DATA_LIST: 36 36 printf("Key Value: %15s ", "psList"); 37 37 break; 38 case PS_ META_BOOL:38 case PS_DATA_BOOL: 39 39 printf("Key Value: %15d ", metadataItem->data.B); 40 40 break; 41 case PS_ META_S32:41 case PS_DATA_S32: 42 42 printf("Key Value: %15d ", metadataItem->data.S32); 43 43 break; 44 case PS_ META_F32:44 case PS_DATA_F32: 45 45 printf("Key Value: %15.3f ", metadataItem->data.F32); 46 46 break; 47 case PS_ META_F64:47 case PS_DATA_F64: 48 48 printf("Key Value: %15.3f ", metadataItem->data.F64); 49 49 break; 50 case PS_ META_STR:50 case PS_DATA_STRING: 51 51 printf("Key Value: %15s ", (char*)metadataItem->data.V); 52 52 break; … … 70 70 // Test A - Allocate metadata and items 71 71 printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata and items"); 72 item1a = psMetadataItemAlloc("myItem1", PS_ META_BOOL, "I am a boolean", true);73 item1b = psMetadataItemAlloc("myItem1", PS_ META_S32, "I am a signed integer", 111);74 item1c = psMetadataItemAlloc("myItem1", PS_ META_S32, "I am a signed integer", 222);75 item2a = psMetadataItemAlloc("myItem2", PS_ META_S32, "I am a signed integer", 333);76 item2b = psMetadataItemAlloc("myItem2", PS_ META_LIST, "I am a list", NULL);72 item1a = psMetadataItemAlloc("myItem1", PS_DATA_BOOL, "I am a boolean", true); 73 item1b = psMetadataItemAlloc("myItem1", PS_DATA_S32, "I am a signed integer", 111); 74 item1c = psMetadataItemAlloc("myItem1", PS_DATA_S32, "I am a signed integer", 222); 75 item2a = psMetadataItemAlloc("myItem2", PS_DATA_S32, "I am a signed integer", 333); 76 item2b = psMetadataItemAlloc("myItem2", PS_DATA_LIST, "I am a list", NULL); 77 77 metadata = psMetadataAlloc(); 78 78 printMetadataItem(item1a); … … 118 118 119 119 tempItem = psMetadataLookup(metadata, item1a->name); 120 if (tempItem == NULL || tempItem->type != PS_ META_MULTI) {120 if (tempItem == NULL || tempItem->type != PS_DATA_METADATA_MULTI) { 121 121 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem didn't add additional metadata entry of same key."); 122 122 return 22; … … 137 137 printFooter(stdout, "psMetadata", "Test D - Add folder node on top of existing leaf node", true); 138 138 tempItem = psMetadataLookup(metadata, item1a->name); 139 if (tempItem == NULL || tempItem->type != PS_ META_MULTI) {139 if (tempItem == NULL || tempItem->type != PS_DATA_METADATA_MULTI) { 140 140 psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem didn't add additional metadata entry of same key."); 141 141 return 24; -
trunk/psLib/test/types/verified/tst_psMetadata_01.stdout
r4547 r5136 9 9 Key Name: BITPIX Key mdType: 0x00000104 Key Value: 8 Key Comment: number of bits per data pixel 10 10 Key Name: NAXIS Key mdType: 0x00000104 Key Value: 0 Key Comment: number of data axes 11 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>11 Key Name: HISTORY Key mdType: 0x00010000 Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE> 12 12 13 13 Contents of metadata table: … … 15 15 Key Name: SIMPLE Key mdType: 0x00001301 Key Value: 1 Key Comment: file does conform to FITS standard 16 16 Key Name: BITPIX Key mdType: 0x00000104 Key Value: 8 Key Comment: number of bits per data pixel 17 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>17 Key Name: HISTORY Key mdType: 0x00010000 Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE> 18 18 19 19 ---> TESTPOINT PASSED (psMetadata{Test A - Read 1st hdr from simple FITS file} | tst_psMetadata_01.c) … … 26 26 27 27 Contents of metadata list: 28 Key Name: XTENSION Key mdType: 0x0001000 1Key Value: 'IMAGE ' Key Comment: IMAGE extension28 Key Name: XTENSION Key mdType: 0x00010000 Key Value: 'IMAGE ' Key Comment: IMAGE extension 29 29 Key Name: BITPIX Key mdType: 0x00000104 Key Value: -64 Key Comment: number of bits per data pixel 30 30 Key Name: NAXIS Key mdType: 0x00000104 Key Value: 1 Key Comment: number of data axes … … 33 33 Key Name: GCOUNT Key mdType: 0x00000104 Key Value: 1 Key Comment: required keyword; must = 1 34 34 Key Name: BITPIX Key mdType: 0x00000104 Key Value: -64 Key Comment: number of bits per data pixel 35 Key Name: EXTNAME Key mdType: 0x0001000 1Key Value: 'MY_DATA_1' Key Comment:36 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>37 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>38 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>39 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>35 Key Name: EXTNAME Key mdType: 0x00010000 Key Value: 'MY_DATA_1' Key Comment: 36 Key Name: HISTORY Key mdType: 0x00010000 Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE> 37 Key Name: HISTORY Key mdType: 0x00010000 Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE> 38 Key Name: HISTORY Key mdType: 0x00010000 Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE> 39 Key Name: HISTORY Key mdType: 0x00010000 Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE> 40 40 41 41 Contents of metadata table: … … 43 43 Key Name: NAXIS1 Key mdType: 0x00000104 Key Value: 64 Key Comment: length of data axis 1 44 44 Key Name: PCOUNT Key mdType: 0x00000104 Key Value: 0 Key Comment: required keyword; must = 0 45 Key Name: XTENSION Key mdType: 0x0001000 1Key Value: 'IMAGE ' Key Comment: IMAGE extension46 Key Name: BITPIX Key mdType: 0x000100 0aKey Value: Key Comment:45 Key Name: XTENSION Key mdType: 0x00010000 Key Value: 'IMAGE ' Key Comment: IMAGE extension 46 Key Name: BITPIX Key mdType: 0x00010023 Key Value: Key Comment: 47 47 Key Name: BITPIX Key mdType: 0x00000104 Key Value: -64 Key Comment: number of bits per data pixel 48 48 Key Name: BITPIX Key mdType: 0x00000104 Key Value: -64 Key Comment: number of bits per data pixel 49 49 Key Name: GCOUNT Key mdType: 0x00000104 Key Value: 1 Key Comment: required keyword; must = 1 50 Key Name: HISTORY Key mdType: 0x000100 0aKey Value: Key Comment:51 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>52 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>53 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>54 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>55 Key Name: EXTNAME Key mdType: 0x0001000 1Key Value: 'MY_DATA_1' Key Comment:50 Key Name: HISTORY Key mdType: 0x00010023 Key Value: Key Comment: 51 Key Name: HISTORY Key mdType: 0x00010000 Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE> 52 Key Name: HISTORY Key mdType: 0x00010000 Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE> 53 Key Name: HISTORY Key mdType: 0x00010000 Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE> 54 Key Name: HISTORY Key mdType: 0x00010000 Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE> 55 Key Name: EXTNAME Key mdType: 0x00010000 Key Value: 'MY_DATA_1' Key Comment: 56 56 57 57 ---> TESTPOINT PASSED (psMetadata{Test B - Read 2nd hdr from complex FITS file} | tst_psMetadata_01.c) … … 64 64 65 65 Contents of metadata list: 66 Key Name: XTENSION Key mdType: 0x0001000 1Key Value: 'IMAGE ' Key Comment: IMAGE extension66 Key Name: XTENSION Key mdType: 0x00010000 Key Value: 'IMAGE ' Key Comment: IMAGE extension 67 67 Key Name: BITPIX Key mdType: 0x00000104 Key Value: -64 Key Comment: number of bits per data pixel 68 68 Key Name: NAXIS Key mdType: 0x00000104 Key Value: 1 Key Comment: number of data axes … … 70 70 Key Name: PCOUNT Key mdType: 0x00000104 Key Value: 0 Key Comment: required keyword; must = 0 71 71 Key Name: GCOUNT Key mdType: 0x00000104 Key Value: 1 Key Comment: required keyword; must = 1 72 Key Name: EXTNAME Key mdType: 0x0001000 1Key Value: 'MY_DATA_2' Key Comment:73 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>74 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>72 Key Name: EXTNAME Key mdType: 0x00010000 Key Value: 'MY_DATA_2' Key Comment: 73 Key Name: HISTORY Key mdType: 0x00010000 Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE> 74 Key Name: HISTORY Key mdType: 0x00010000 Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE> 75 75 76 76 Contents of metadata table: … … 78 78 Key Name: NAXIS1 Key mdType: 0x00000104 Key Value: 64 Key Comment: length of data axis 1 79 79 Key Name: PCOUNT Key mdType: 0x00000104 Key Value: 0 Key Comment: required keyword; must = 0 80 Key Name: XTENSION Key mdType: 0x0001000 1Key Value: 'IMAGE ' Key Comment: IMAGE extension80 Key Name: XTENSION Key mdType: 0x00010000 Key Value: 'IMAGE ' Key Comment: IMAGE extension 81 81 Key Name: GCOUNT Key mdType: 0x00000104 Key Value: 1 Key Comment: required keyword; must = 1 82 82 Key Name: BITPIX Key mdType: 0x00000104 Key Value: -64 Key Comment: number of bits per data pixel 83 Key Name: HISTORY Key mdType: 0x000100 0aKey Value: Key Comment:84 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>85 Key Name: HISTORY Key mdType: 0x0001000 1Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE>86 Key Name: EXTNAME Key mdType: 0x0001000 1Key Value: 'MY_DATA_2' Key Comment:83 Key Name: HISTORY Key mdType: 0x00010023 Key Value: Key Comment: 84 Key Name: HISTORY Key mdType: 0x00010000 Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE> 85 Key Name: HISTORY Key mdType: 0x00010000 Key Value: Key Comment: File modified by user 'harman' with fv on 2004-08-04T<DATE> 86 Key Name: EXTNAME Key mdType: 0x00010000 Key Value: 'MY_DATA_2' Key Comment: 87 87 88 88 ---> TESTPOINT PASSED (psMetadata{Test C - Read named hdr from complex FITS file} | tst_psMetadata_01.c) … … 97 97 98 98 Contents of metadata list: 99 Key Name: XTENSION Key mdType: 0x0001000 1Key Value: 'IMAGE ' Key Comment: IMAGE extension99 Key Name: XTENSION Key mdType: 0x00010000 Key Value: 'IMAGE ' Key Comment: IMAGE extension 100 100 Key Name: BITPIX Key mdType: 0x00000104 Key Value: -64 Key Comment: number of bits per data pixel 101 101 Key Name: NAXIS Key mdType: 0x00000104 Key Value: 1 Key Comment: number of data axes … … 103 103 Key Name: PCOUNT Key mdType: 0x00000104 Key Value: 0 Key Comment: required keyword; must = 0 104 104 Key Name: GCOUNT Key mdType: 0x00000104 Key Value: 1 Key Comment: required keyword; must = 1 105 Key Name: EXTNAME Key mdType: 0x0001000 1Key Value: 'MY_DATA_2' Key Comment:105 Key Name: EXTNAME Key mdType: 0x00010000 Key Value: 'MY_DATA_2' Key Comment: 106 106 107 107 Contents of metadata table: … … 109 109 Key Name: NAXIS1 Key mdType: 0x00000104 Key Value: 64 Key Comment: length of data axis 1 110 110 Key Name: PCOUNT Key mdType: 0x00000104 Key Value: 0 Key Comment: required keyword; must = 0 111 Key Name: XTENSION Key mdType: 0x0001000 1Key Value: 'IMAGE ' Key Comment: IMAGE extension111 Key Name: XTENSION Key mdType: 0x00010000 Key Value: 'IMAGE ' Key Comment: IMAGE extension 112 112 Key Name: GCOUNT Key mdType: 0x00000104 Key Value: 1 Key Comment: required keyword; must = 1 113 113 Key Name: BITPIX Key mdType: 0x00000104 Key Value: -64 Key Comment: number of bits per data pixel 114 Key Name: EXTNAME Key mdType: 0x0001000 1Key Value: 'MY_DATA_2' Key Comment:114 Key Name: EXTNAME Key mdType: 0x00010000 Key Value: 'MY_DATA_2' Key Comment: 115 115 116 116 ---> TESTPOINT PASSED (psMetadata{Test D - Remove items with same name from all metadata} | tst_psMetadata_01.c) -
trunk/psLib/test/types/verified/tst_psMetadata_02.stdout
r4547 r5136 9 9 Key Name: myItem3 Key mdType: 0x00000404 Key Value: 222.222 Key Comment: I am a single precision floating point 10 10 Key Name: myItem4 Key mdType: 0x00000408 Key Value: 333.333 Key Comment: I am a double precision floating point 11 Key Name: myItem5 Key mdType: 0x0001000 1Key Value: HELLO WORLD Key Comment: I am a string11 Key Name: myItem5 Key mdType: 0x00010000 Key Value: HELLO WORLD Key Comment: I am a string 12 12 13 13 ---> TESTPOINT PASSED (psMetadata{Test A - Allocate metadata items} | tst_psMetadata_02.c) … … 28 28 * TestPoint: psMetadata{Test C - Attempt to create metadata item with invalid type} * 29 29 * TestType: Negative * 30 * ExpectedErrorText: Invalid ps MetadataType: 6*30 * ExpectedErrorText: Invalid psDataType: 6 * 31 31 * ExpectedStatusValue: 0 * 32 32 \**********************************************************************************/ -
trunk/psLib/test/types/verified/tst_psMetadata_06.stdout
r4547 r5136 9 9 Key Name: myItem1 Key mdType: 0x00000104 Key Value: 222 Key Comment: I am a signed integer 10 10 Key Name: myItem2 Key mdType: 0x00000104 Key Value: 333 Key Comment: I am a signed integer 11 Key Name: myItem2 Key mdType: 0x0001000 0Key Value: psList Key Comment: I am a list11 Key Name: myItem2 Key mdType: 0x0001000b Key Value: psList Key Comment: I am a list 12 12 13 13 ---> TESTPOINT PASSED (psMetadata{Test A - Allocate metadata and items} | tst_psMetadata_06.c)
Note:
See TracChangeset
for help on using the changeset viewer.
