IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 25, 2008, 4:43:13 PM (18 years ago)
Author:
jhoblitt
Message:

add chiptool -updaterun

File:
1 edited

Legend:

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

    r16725 r17148  
    3535
    3636static bool queueMode(pxConfig *config);
     37static bool updaterunMode(pxConfig *config);
    3738static bool pendingimfileMode(pxConfig *config);
    3839static bool addprocessedimfileMode(pxConfig *config);
     
    6566    switch (config->mode) {
    6667        MODECASE(CHIPTOOL_MODE_QUEUE,                   queueMode);
     68        MODECASE(CHIPTOOL_MODE_UPDATERUN,               updaterunMode);
    6769        MODECASE(CHIPTOOL_MODE_PENDINGIMFILE,           pendingimfileMode);
    6870        MODECASE(CHIPTOOL_MODE_ADDPROCESSEDIMFILE,      addprocessedimfileMode);
     
    247249}
    248250
     251
     252static bool updaterunMode(pxConfig *config)
     253{
     254    PS_ASSERT_PTR_NON_NULL(config, NULL);
     255
     256    PXOPT_LOOKUP_STR(chip_id, config->args, "-chip_id", true, false);
     257    PXOPT_LOOKUP_STR(state, config->args, "-state", false, false);
     258    PXOPT_LOOKUP_STR(label, config->args, "-label", false, false);
     259
     260    if ((!state) && (!label)) {
     261        psError(PXTOOLS_ERR_DATA, false, "parameters are required");
     262        return false;
     263    }
     264
     265    if (state) {
     266        // set chipRun.state to state
     267        if (!pxchipRunSetState(config, (psS64)atoll(chip_id), state)) {
     268            return false;
     269        }
     270    }
     271
     272    if (label) {
     273        // set chipRun.label to label
     274        if (!pxchipRunSetLabel(config, (psS64)atoll(chip_id), label)) {
     275            return false;
     276        }
     277    }
     278
     279    return true;
     280}
     281
     282
    249283static bool pendingimfileMode(pxConfig *config)
    250284{
Note: See TracChangeset for help on using the changeset viewer.