IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8312


Ignore:
Timestamp:
Aug 14, 2006, 10:05:05 AM (20 years ago)
Author:
drobbin
Message:

Updated doxygen in region. Updated printing in metadata. Updated itemPrint in MetaConfig. Edited MetaItemCompare tap test and added/updated MetaItemParse tap test

Location:
trunk/psLib
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psRegion.h

    r7901 r8312  
    1111typedef struct
    1212{
    13     float x0;                         ///< the first column of the region.
    14     float x1;                         ///< the last column of the region.
    15     float y0;                         ///< the first row of the region.
    16     float y1;                         ///< the last row of the region.
     13    float x0;                          ///< the first column of the region.
     14    float x1;                          ///< the last column of the region.
     15    float y0;                          ///< the first row of the region.
     16    float y1;                          ///< the last row of the region.
    1717}
    1818psRegion;
     
    2222 * @return psRegion* : a new psRegion.
    2323 */
    24 psRegion *psRegionAlloc(float x0,       ///< the first column of the region.
    25                         float x1,       ///< the last column of the region + 1.
    26                         float y0,       ///< the first row of the region.
    27                         float y1        ///< the last row of the region + 1.
    28                        );
     24psRegion *psRegionAlloc(
     25    float x0,                          ///< the first column of the region.
     26    float x1,                          ///< the last column of the region + 1.
     27    float y0,                          ///< the first row of the region.
     28    float y1                           ///< the last row of the region + 1.
     29);
    2930
    3031/** Checks the type of a particular pointer.
     
    4041/** Create a psRegion with the specified attributes.
    4142 *
    42  *  @return psRegion : a cooresponding psRegion.
     43 *  @return psRegion :      a corresponding psRegion.
    4344 */
    4445psRegion psRegionSet(
     
    5455 *  shall be of the standard IRAF form '[x0:x1,y0:y1]'
    5556 *
    56  *  @return psRegion:  A new psRegion struct, or NULL is not successful.
     57 *  @return psRegion:       A new psRegion struct, or NULL is not successful.
    5758 */
    5859psRegion psRegionFromString(
     
    7576 */
    7677psRegion psRegionForSquare(
    77     double x,                           ///< x coordinate at square-center
    78     double y,                           ///< y coordinate at square-center
    79     double radius                       ///< radius of square
     78    double x,                          ///< x coordinate at square-center
     79    double y,                          ///< y coordinate at square-center
     80    double radius                      ///< radius of square
    8081);
    8182
  • trunk/psLib/src/types/psMetadata.c

    r8245 r8312  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.122 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2006-08-09 02:26:44 $
     14 *  @version $Revision: 1.123 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-08-14 20:05:05 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    11941194    psMetadataItem *item = NULL; // Item from metadata
    11951195    while ( (item = psMetadataGetAndIncrement(iter)) ) {
    1196         // Indent...
    1197         for (int i = 0; i < level; i++) {
    1198             fprintf(fd, "  ");
    1199         }
    1200         fprintf(fd, "%s", item->name);
    1201         if (item->comment && strlen(item->comment) > 0) {
    1202             fprintf(fd, " (%s)", item->comment);
    1203         }
    1204         fprintf(fd, ": ");
     1196        //So that unsupported types are not printed here, adding a switch statement
     1197        switch(item->type) {
     1198        case PS_DATA_STRING:
     1199        case PS_DATA_BOOL:
     1200        case PS_DATA_S8:
     1201        case PS_DATA_S16:
     1202        case PS_DATA_S32:
     1203        case PS_DATA_S64:
     1204        case PS_DATA_U8:
     1205        case PS_DATA_U16:
     1206        case PS_DATA_U32:
     1207        case PS_DATA_U64:
     1208        case PS_DATA_F32:
     1209        case PS_DATA_F64:
     1210        case PS_DATA_METADATA:
     1211        case PS_DATA_REGION:
     1212        case PS_DATA_LIST:
     1213        case PS_DATA_TIME:
     1214        case PS_DATA_VECTOR:
     1215            // Indent...
     1216            //                fprintf(fd, "\n");
     1217            for (int i = 0; i < level; i++) {
     1218                fprintf(fd, "  ");
     1219            }
     1220            fprintf(fd, "%s", item->name);
     1221            if (item->comment && strlen(item->comment) > 0) {
     1222                fprintf(fd, " (%s)", item->comment);
     1223            }
     1224            fprintf(fd, ": ");
     1225            break;
     1226        case PS_DATA_UNKNOWN:
     1227        default:
     1228            break;
     1229        }
    12051230        switch (item->type) {
    12061231        case PS_DATA_STRING:
    1207             fprintf(fd, "%s", (char*)(item->data.V));
     1232            fprintf(fd, "%s\n", (char*)(item->data.V));
    12081233            break;
    12091234        case PS_DATA_BOOL:
    12101235            if (item->data.B) {
    1211                 fprintf(fd, "True");
     1236                fprintf(fd, "True\n");
    12121237            } else {
    1213                 fprintf(fd, "False");
     1238                fprintf(fd, "False\n");
    12141239            }
    12151240            break;
    12161241        case PS_DATA_S8:
    1217             fprintf(fd, "%d", item->data.S8);
     1242            fprintf(fd, "%d\n", item->data.S8);
    12181243            break;
    12191244        case PS_DATA_S16:
    1220             fprintf(fd, "%d", item->data.S16);
     1245            fprintf(fd, "%d\n", item->data.S16);
    12211246            break;
    12221247        case PS_DATA_S32:
    1223             fprintf(fd, "%d", item->data.S32);
     1248            fprintf(fd, "%d\n", item->data.S32);
    12241249            break;
    12251250        case PS_DATA_S64:
    1226             fprintf(fd, "%jd", item->data.S64);
     1251            fprintf(fd, "%jd\n", item->data.S64);
    12271252            break;
    12281253        case PS_DATA_U8:
    1229             fprintf(fd, "%u", item->data.U8);
     1254            fprintf(fd, "%u\n", item->data.U8);
    12301255            break;
    12311256        case PS_DATA_U16:
    1232             fprintf(fd, "%u", item->data.U16);
     1257            fprintf(fd, "%u\n", item->data.U16);
    12331258            break;
    12341259        case PS_DATA_U32:
    1235             fprintf(fd, "%u", item->data.U32);
     1260            fprintf(fd, "%u\n", item->data.U32);
    12361261            break;
    12371262        case PS_DATA_U64:
    1238             fprintf(fd, "%ju", item->data.U64);
     1263            fprintf(fd, "%ju\n", item->data.U64);
    12391264            break;
    12401265        case PS_DATA_F32:
    1241             fprintf(fd, "%f", item->data.F32);
     1266            fprintf(fd, "%f\n", item->data.F32);
    12421267            break;
    12431268        case PS_DATA_F64:
    1244             fprintf(fd, "%f", item->data.F64);
     1269            fprintf(fd, "%f\n", item->data.F64);
    12451270            break;
    12461271        case PS_DATA_METADATA:
     
    12541279        case PS_DATA_REGION: {
    12551280                psString region = psRegionToString(*(psRegion*)item->data.V);
    1256                 fprintf(fd, "%s", region);
     1281                fprintf(fd, "%s\n", region);
    12571282                psFree(region);
    12581283                break;
    12591284            }
    12601285        case PS_DATA_LIST:
    1261             fprintf(fd, "<a list of unknown contents>");
     1286            fprintf(fd, "<a list of unknown contents>\n");
    12621287            break;
    12631288        case PS_DATA_TIME: {
    12641289                psString time = psTimeToISO(item->data.V);
    1265                 fprintf(fd, "%s", time);
     1290                fprintf(fd, "%s\n", time);
    12661291                psFree(time);
    12671292                break;
     
    12751300                        fprintf(fd, "%u ", vector->data.U8[i]);
    12761301                    }
     1302                    fprintf(fd, "\n");
    12771303                    break;
    12781304                case PS_DATA_U16:
     
    12811307                        fprintf(fd, "%u ", vector->data.U16[i]);
    12821308                    }
     1309                    fprintf(fd, "\n");
    12831310                    break;
    12841311                case PS_DATA_U32:
     
    12871314                        fprintf(fd, "%u ", vector->data.U32[i]);
    12881315                    }
     1316                    fprintf(fd, "\n");
    12891317                    break;
    12901318                case PS_DATA_U64:
     
    12931321                        fprintf(fd, "%ju ", vector->data.U64[i]);
    12941322                    }
     1323                    fprintf(fd, "\n");
    12951324                    break;
    12961325                case PS_DATA_S8:
     
    12991328                        fprintf(fd, "%d ", vector->data.S8[i]);
    13001329                    }
     1330                    fprintf(fd, "\n");
    13011331                    break;
    13021332                case PS_DATA_S16:
     
    13051335                        fprintf(fd, "%d ", vector->data.S16[i]);
    13061336                    }
     1337                    fprintf(fd, "\n");
    13071338                    break;
    13081339                case PS_DATA_S32:
     
    13111342                        fprintf(fd, "%d ", vector->data.S32[i]);
    13121343                    }
     1344                    fprintf(fd, "\n");
    13131345                    break;
    13141346                case PS_DATA_S64:
     
    13171349                        fprintf(fd, "%jd ", vector->data.S64[i]);
    13181350                    }
     1351                    fprintf(fd, "\n");
    13191352                    break;
    13201353                case PS_DATA_F32:
     
    13231356                        fprintf(fd, "%f ", vector->data.F32[i]);
    13241357                    }
     1358                    fprintf(fd, "\n");
    13251359                    break;
    13261360                case PS_DATA_F64:
     
    13291363                        fprintf(fd, "%f ", vector->data.F64[i]);
    13301364                    }
     1365                    fprintf(fd, "\n");
    13311366                    break;
    13321367                case PS_DATA_UNKNOWN:
     
    13341369                    psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    13351370                            _("Specified psDataType, %d, is not supported."), vector->type.type);
     1371                    psFree(iter);
     1372                    fprintf(fd, "<Unsupported type>\n");
    13361373                    return false;
    13371374                }
     1375                //                fprintf(fd, "\n");
    13381376                break;
    13391377            }
    13401378        default:
    1341             fprintf(fd, "\n");
     1379            //            fprintf(fd, "\n");
    13421380            psError(PS_ERR_IO, false, "Non-printable metadata type: %x\n", item->type);
    1343         }
    1344         fprintf(fd, "\n");
    1345     }
     1381            break;
     1382        }
     1383        //        fprintf(fd, "\n");
     1384    }
     1385    //    fprintf(fd, "\n");
    13461386    psFree(iter);
    13471387
  • trunk/psLib/src/types/psMetadataConfig.c

    r8298 r8312  
    1010*  @author Eric Van Alst, MHPCC
    1111*
    12 *  @version $Revision: 1.71 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2006-08-12 02:53:36 $
     12*  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2006-08-14 20:05:05 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    453453    psBool success = true;
    454454
    455     PS_ASSERT_PTR_NON_NULL(fd, success);
    456     PS_ASSERT_PTR_NON_NULL(format, success);
    457     PS_ASSERT_PTR_NON_NULL(item, success);
     455    PS_ASSERT_PTR_NON_NULL(fd, false);
     456    PS_ASSERT_PTR_NON_NULL(format, false);
     457    PS_ASSERT_PTR_NON_NULL(item, false);
    458458
    459459    type = item->type;
     
    464464        // well, the format contains no reference to the metadataItem's data:
    465465        // that is truly trival to do!
    466         fprintf(fd,format);
    467         return success;
     466        //        fprintf(fd,format);
     467        return false;
    468468    }
    469469
     
    552552        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
    553553                _("Specified print format, %%%c, is not supported."), *fType);
     554        success = false;
    554555        break;
    555556    }
  • trunk/psLib/src/types/psMetadataConfig.h

    r7245 r8312  
    1010 *  @author Robert DeSonia, MHPCC
    1111 *
    12  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2006-05-30 22:18:39 $
     12 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2006-08-14 20:05:05 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4848 *  this formatting command must also be numeric, and the type conversion
    4949 *  performed to the value to match the format type. If the metadata type is
    50  *  a string, the fromatting command must also be for a string. If the
     50 *  a string, the formatting command must also be for a string. If the
    5151 *  metadata type is any other data type, printing is not allowed.
    5252 *
    53  * @return psMetadataItem* : Pointer metadata item.
     53 * @return psMetadataItem* :    Pointer metadata item.
    5454 */
    5555bool psMetadataItemPrint(
  • trunk/psLib/test/types/Makefile.am

    r8257 r8312  
    3131        tap_psMetadataConfigParse \
    3232        tap_psMetadataItemCompare \
    33         tap_psMetadataItemParse
     33        tap_psMetadataItemParse \
     34        tap_psMetadata_printing
    3435
    3536
     
    6970tap_psMetadataItemParse_CPPFLAGS   = $(AM_CPPFLAGS) -I$(top_srcdir)/test/tap/src
    7071tap_psMetadataItemParse_LDFLAGS    = $(AM_LDFLAGS) $(top_builddir)/test/tap/src/libtap.la
     72
     73tap_psMetadata_printing_CPPFLAGS   = $(AM_CPPFLAGS) -I$(top_srcdir)/test/tap/src
     74tap_psMetadata_printing_LDFLAGS    = $(AM_LDFLAGS) $(top_builddir)/test/tap/src/libtap.la
    7175
    7276check_DATA = \
  • trunk/psLib/test/types/tap_psMetadataItemCompare.c

    r8269 r8312  
    1 #include <stdio.h>
     1
    22#include "pstap.h"
    33
  • trunk/psLib/test/types/tap_psMetadataItemParse.c

    r8269 r8312  
    1 #include <stdio.h>
     1
    22#include "pstap.h"
    33
Note: See TracChangeset for help on using the changeset viewer.