IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5007 for trunk/psLib/src/types


Ignore:
Timestamp:
Sep 12, 2005, 1:05:00 PM (21 years ago)
Author:
drobbin
Message:

added psTime support to psMetadataConfigFormat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psMetadataConfig.c

    r4979 r5007  
    1010*  @author Eric Van Alst, MHPCC
    1111*
    12 *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-09-09 01:11:23 $
     12*  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-09-12 23:04:59 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    11851185        if ( type == 65538)
    11861186            type = PS_DATA_VECTOR;
    1187         if ( type == 65547)
     1187        if ( type == 65549)
     1188            type = PS_DATA_TIME;
     1189        if ( item->type == PS_META_META)
    11881190            type = PS_DATA_METADATA;
    11891191
     
    12871289            }
    12881290            psFree(newStr);
     1291            break;
     1292        case PS_DATA_TIME:
     1293            snprintf(content, MAXSTR, "%s ", item->name);
     1294            if ( ((psTime*)(item->data.V))->type == PS_TIME_UTC )
     1295                strncat(content, "PS_TIME_UTC  ", MAXSTR);
     1296            else if ( ((psTime*)(item->data.V))->type == PS_TIME_TAI )
     1297                strncat(content, "PS_TIME_TAI  ", MAXSTR);
     1298            else if ( ((psTime*)(item->data.V))->type == PS_TIME_UT1 )
     1299                strncat(content, "PS_TIME_UT1  ", MAXSTR);
     1300            else if ( ((psTime*)(item->data.V))->type == PS_TIME_TT )
     1301                strncat(content, "PS_TIME_TT  ", MAXSTR);
     1302            else {
     1303                psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     1304                        PS_ERRORTEXT_psMetadata_METATYPE_INVALID, type);
     1305                psFree(iter);
     1306                return NULL;
     1307            }
     1308            strncat(mdString, content, MAXSTR);
     1309
     1310            snprintf(content, MAXSTR, "%ld, ", ((psTime*)(item->data.V))->sec);
     1311            strncat(mdString, content, MAXSTR);
     1312            snprintf(content, MAXSTR, "%u, ", ((psTime*)(item->data.V))->nsec);
     1313            strncat(mdString, content, MAXSTR);
     1314            if ( ((psTime*)(item->data.V))->leapsecond )
     1315                strncat(mdString, "T ", MAXSTR);
     1316            else
     1317                strncat(mdString, "F ", MAXSTR);
     1318            if ( item->comment != NULL ) {
     1319                snprintf(content, MAXSTR, " #%s \n", item->comment);
     1320                strncat(mdString, content, MAXSTR);
     1321            } else {
     1322                snprintf(content, MAXSTR, "\n");
     1323                strncat(mdString, content, MAXSTR);
     1324            }
    12891325            break;
    12901326        case PS_DATA_VECTOR:
Note: See TracChangeset for help on using the changeset viewer.