Changeset 304
- Timestamp:
- 01/12/2011 04:40:56 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SH_SHM/trunk/source/seed_io/sfd2db.c
r172 r304 3 3 * ======== 4 4 * 5 * $Revision: 1 01 $, $Date: 2009-11-27 11:48:20 +0100 (Fr, 27 Nov 2009) $5 * $Revision: 146 $, $Date: 2011-01-12 16:33:37 +0100 (Mi, 12 Jan 2011) $ 6 6 * 7 7 * reads lines from sfdfile and creates commands to insert into sfdb database … … 37 37 char chan[cBcShortStrLth+1]; /* channel name */ 38 38 char comp; /* component name */ 39 char network[3]; /* network name */ 40 char location[3]; /* location code */ 39 41 int i; /* counter */ 40 42 char rpath[cBcFileLth+1]; /* relative path name */ … … 58 60 TSyBoolean invhdr; /* invert header info in sfd entry */ 59 61 TSyBoolean baynet; /* convert SH to BH for Bayernnetz */ 60 TSyBoolean modgec2; /* modify gec2a and gec2b to gec2 */62 TSyBoolean modgec2; /* modify gec2a and gec2b to gec2 */ 61 63 TSyBoolean go; /* end tmpfile with insert statements with \g */ 62 64 … … 315 317 } /*endif*/ 316 318 319 /* check for additional information (network and location code) */ 320 if (descr.addinf[0] != '\0') { 321 strncpy(network, descr.addinf, 2); 322 network[2] = '\0'; 323 324 for (i=2; i<4; i++) 325 location[i-2] = descr.addinf[i]; 326 327 if (!strncmp(network, "..", 2)) 328 network[0] = '\0'; 329 330 if (!strncmp(location, "..", 2)) 331 location[0] = '\0'; 332 } else { 333 network[0] = '\0'; 334 location[0] = '\0'; 335 } 336 317 337 /* write command line */ 318 338 if (!noinsert) 319 339 fprintf( out, 320 "insert %sinto sftab ( station, chan, comp, pathid, relpath, sdate, stime, edate, etime, recnum, hswap, recsize, offset, dataflags, priority, dataformat ) 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);\n",340 "insert %sinto sftab ( station, chan, comp, pathid, relpath, sdate, stime, edate, etime, recnum, hswap, recsize, offset, dataflags, priority, dataformat, network, location ) 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, \'%s\', \'%s\');\n", 321 341 ignstr, station, chan, comp, pathid, rpath, stime.year, stime.month, stime.day, 322 342 stime.hour, stime.min, stime.sec, stime.ms, etime.year, etime.month, 323 343 etime.day, etime.hour, etime.min, etime.sec, etime.ms, descr.recno, 324 344 descr.swap_hdr, descr.reclth, descr.byteoff, descr.dataflags, priority, 325 dataformat );345 dataformat, network, location ); 326 346 if (update) 327 347 fprintf( out,
Note: See TracChangeset
for help on using the changeset viewer.