IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 26, 2009, 1:59:32 PM (17 years ago)
Author:
beaumont
Message:

merged with trunk

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/ippTools/src

    • Property svn:ignore
      •  

        old new  
        3333pstamptool
        3434disttool
         35receivetool
  • branches/cnb_branches/cnb_branch_20090301/ippTools/src/stacktool.c

    r23352 r24244  
    617617    PXOPT_COPY_S64(config->args, where, "-warp_id", "warp_id", "==");
    618618    PXOPT_COPY_S64(config->args, where, "-stack_id", "stack_id", "==");
    619     PXOPT_COPY_STR(config->args, where, "-label", "stackRun.label", "==");
     619    pxAddLabelSearchArgs (config, where, "-label", "stackRun.label", "==");
    620620
    621621    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
     
    718718
    719719    // default values
    720     PXOPT_LOOKUP_S16(code, config->args, "-code", false, false);
     720    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
     721    PXOPT_LOOKUP_S16(quality, config->args, "-quality", false, false);
    721722
    722723    if (!psDBTransaction(config->dbh)) {
     
    754755                               hostname,
    755756                               good_frac,
    756                                code
     757                               fault,
     758                               quality
    757759          )) {
    758760        if (!psDBRollback(config->dbh)) {
     
    862864    PXOPT_COPY_S64(config->args, where, "-stack_id", "stackSumSkyfile.stack_id", "==");
    863865    PXOPT_COPY_STR(config->args, where, "-label", "stackRun.label", "==");
    864     PXOPT_COPY_S16(config->args, where, "-code", "stackSumSkyfile.fault", "==");
     866    PXOPT_COPY_S16(config->args, where, "-fault", "stackSumSkyfile.fault", "==");
    865867
    866868    if (!psDBTransaction(config->dbh)) {
     
    989991
    990992    psMetadata *where = psMetadataAlloc();
    991     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     993    pxAddLabelSearchArgs (config, where, "-label", "stackRun.label", "==");
    992994
    993995    psString query = pxDataGet("stacktool_pendingcleanuprun.sql");
     
    10531055        PXOPT_COPY_S64(config->args, where, "-stack_id", "stack_id", "==");
    10541056    }
    1055     PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     1057    pxAddLabelSearchArgs (config, where, "-label", "stackRun.label", "==");
    10561058
    10571059    psString query = pxDataGet("stacktool_pendingcleanupskyfile.sql");
     
    11691171    PS_ASSERT_PTR_NON_NULL(config, false);
    11701172
    1171     PXOPT_LOOKUP_S16(code, config->args, "-code", true, false);
     1173    PXOPT_LOOKUP_S16(fault, config->args, "-fault", true, false);
    11721174
    11731175    psMetadata *where = psMetadataAlloc();
    11741176    PXOPT_COPY_S64(config->args, where, "-stack_id",   "stack_id",   "==");
    11751177
    1176     if (!pxSetFaultCode(config->dbh, "stackSumSkyfile", where, code)) {
     1178    if (!pxSetFaultCode(config->dbh, "stackSumSkyfile", where, fault)) {
    11771179        psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag");
    11781180        psFree (where);
     
    11921194
    11931195  int numExportTables = 3;
    1194  
     1196
    11951197  PS_ASSERT_PTR_NON_NULL(config, NULL);
    11961198
    11971199  PXOPT_LOOKUP_S64(det_id, config->args, "-stack_id", true,  false);
    11981200  PXOPT_LOOKUP_STR(outfile, config->args, "-outfile", true,  false);
     1201  PXOPT_LOOKUP_BOOL(clean, config->args, "-clean", false);
    11991202  PXOPT_LOOKUP_U64(limit,   config->args, "-limit",   false, false);
    12001203
     
    12471250    }
    12481251    if (!psArrayLength(output)) {
    1249       psTrace("regtool", PS_LOG_INFO, "no rows found");
     1252      psError(PS_ERR_UNKNOWN, true, "no rows found");
    12501253      psFree(output);
    1251       return true;
    1252     }
     1254      return false;
     1255    }
     1256
     1257    if (clean) {
     1258        if (!strcmp(tables[i].tableName, "stackRun")) {
     1259            if (!pxSetStateCleaned("stackRun", "state", output)) {
     1260                psFree(output);
     1261                psError(PS_ERR_UNKNOWN, false, "pxSetStateClean failed for table %s",  tables[i].tableName);
     1262                return false;
     1263            }
     1264        }
     1265    }
     1266
     1267      // we must write the export table in non-simple (true) format
     1268    if (!ippdbPrintMetadatas(f, output, tables[i].tableName, true)) {
     1269        psError(PS_ERR_UNKNOWN, false, "failed to print array");
     1270        psFree(output);
     1271        return false;
     1272    }
     1273
    12531274    psFree(output);
    12541275  }
     
    12621283{
    12631284  unsigned int nFail;
    1264  
     1285
    12651286  int numImportTables = 2;
    1266  
     1287
    12671288  char tables[2] [80] = {"stackInputSkyfile", "stackSumSkyfile"};
    12681289
    12691290  PS_ASSERT_PTR_NON_NULL(config, NULL);
    1270  
     1291
    12711292  PXOPT_LOOKUP_STR(infile, config->args, "-infile", true,  false);
    12721293
     
    12931314    psAssert (item, "entry not in input?");
    12941315    psAssert (item->type == PS_DATA_METADATA_MULTI, "entry not multi?");
    1295  
     1316
    12961317    switch (i) {
    12971318      case 0:
     
    13071328        }
    13081329        break;
    1309        
     1330
    13101331      case 1:
    13111332        for (int i = 0; i < item->data.list->n; i++) {
     
    13221343    }
    13231344  }
    1324  
     1345
    13251346  return true;
    13261347}
Note: See TracChangeset for help on using the changeset viewer.