Changeset 310 for SH_SHM/trunk


Ignore:
Timestamp:
01/26/2011 12:14:48 PM (13 years ago)
Author:
marcus
Message:

r152 | walther | 2011-01-26 12:13:52 +0100 (Mi, 26 Jan 2011) | 2 lines

  • one-digit network codes are now supported (like G = GeoScope?).
  • minor clean-up
File:
1 edited

Legend:

Unmodified
Added
Removed
  • SH_SHM/trunk/source/seed_io/sfd2db.c

    r307 r310  
    33 *      ======== 
    44 * 
    5  * $Revision: 149 $, $Date: 2011-01-14 05:46:15 +0100 (Fr, 14 Jan 2011) $ 
     5 * $Revision: 152 $, $Date: 2011-01-26 12:13:52 +0100 (Mi, 26 Jan 2011) $ 
    66 * 
    77 * reads lines from sfdfile and creates commands to insert into sfdb database 
     
    322322                    network[2] = '\0'; 
    323323 
     324                    /* one digit network codes are common */ 
     325                    if (network[1] == '.') 
     326                        network[1] = '\0'; 
     327 
     328                    /* no network set at all. */ 
     329                    if (!strncmp(network, "..", 2)) 
     330                        network[0] = '\0'; 
     331 
    324332                    for (i=2; i<4; i++) 
    325333                        location[i-2] = descr.addinf[i]; 
    326334                        location[2] = '\0'; 
    327335 
    328                     if (!strncmp(network, "..", 2)) 
    329                         network[0] = '\0'; 
    330  
     336                    /* The SEED manual states for the "Location identifier": 
     337                     * Left justify and pad with spaces. Especially for file 
     338                     * system this is quite weird, so we support 2 digits only. 
     339                     * (for now). 
     340                     */ 
    331341                    if (!strncmp(location, "..", 2)) 
    332342                        location[0] = '\0'; 
     
    354364                sfcnt++; 
    355365 
    356                 /* old lines for mysql  
    357                                 "insert %sinto sftab values ( \"%s\", \"%s\", \"%c\", \"%d\", \"%s\", \"%4d%02d%02d\", \"%2d%02d%02d.%03d\", \"%4d%02d%02d\", \"%2d%02d%02d.%03d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", NULL );\n", 
    358                                 "update %ssftab set sdate=\"%4d%02d%02d\", stime=\"%2d%02d%02d.%03d\", edate=\"%4d%02d%02d\", etime=\"%2d%02d%02d.%03d\", recnum=\"%d\", dataflags=\"%d\", priority=\"%d\", dataformat=\"%d\", hswap=\"%d\" where pathid=\"%d\" and relpath=\"%s\";\n", 
    359                 */ 
    360  
    361366        } /*endwhile*/ 
    362367 
     
    367372                fclose( out ); 
    368373 
    369                 /*sprintf( shellcmd, "cat %s", tmpfile );*/ 
    370374                /*system( shellcmd );*/ 
    371375                sprintf( shellcmd, "%s sfdb < %s", sfdbreqscriptfile, tmpfile ); 
Note: See TracChangeset for help on using the changeset viewer.