IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 15, 2009, 9:33:58 AM (17 years ago)
Author:
bills
Message:

add -clean argument to the exportrun modes. If set switch
state and data state from 'full' to 'cleaned'.
If no rows are found in -exportrun return error status for
the command

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/warptool.c

    r23809 r23873  
    16061606    PS_ASSERT_PTR_NON_NULL(config, NULL);
    16071607
    1608     PXOPT_LOOKUP_S64(det_id, config->args, "-warp_id", true,  false);
     1608    PXOPT_LOOKUP_S64(det_id,  config->args, "-warp_id", true,  false);
    16091609    PXOPT_LOOKUP_STR(outfile, config->args, "-outfile", true,  false);
    16101610    PXOPT_LOOKUP_U64(limit,   config->args, "-limit",   false, false);
     1611    PXOPT_LOOKUP_BOOL(clean,  config->args, "-clean", false);
    16111612
    16121613    FILE *f = fopen (outfile, "w");
     
    16611662      }
    16621663      if (!psArrayLength(output)) {
    1663         psTrace("regtool", PS_LOG_INFO, "no rows found");
     1664        psError(PS_ERR_UNKNOWN, true, "no rows found");
    16641665        psFree(output);
    1665         return true;
     1666        return false;
    16661667      }
     1668
     1669    if (clean) {
     1670        bool success = true;
     1671        if (!strcmp(tables[i].tableName, "warpRun")) {
     1672            success = pxSetStateCleaned("warpRun", "state", output);
     1673        } else if (!strcmp(tables[i].tableName, "warpSkyfile")) {
     1674            success = pxSetStateCleaned("warpSkyfile", "data_state", output);
     1675        }
     1676        if (!success) {
     1677            psFree(output);
     1678            psError(PS_ERR_UNKNOWN, false, "pxSetStateClean failed for table %s",  tables[i].tableName);
     1679            return false;
     1680        }
     1681    }
    16671682
    16681683      // we must write the export table in non-simple (true) format
Note: See TracChangeset for help on using the changeset viewer.