IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31680


Ignore:
Timestamp:
Jun 22, 2011, 1:59:04 PM (15 years ago)
Author:
heather
Message:

addtool now requires either -destreaked or -uncensored. It won't work
otherwise. The ippTasks need to be updated for this.

Location:
trunk/ippTools/src
Files:
2 edited

Legend:

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

    r31596 r31680  
    161161    PXOPT_LOOKUP_BOOL(minidvodb,  config->args, "-set_minidvodb", false);
    162162    PXOPT_LOOKUP_BOOL(destreaked, config->args, "-destreaked", false);
     163    PXOPT_LOOKUP_BOOL(uncensored, config->args, "-uncensored", false);
    163164    PXOPT_LOOKUP_BOOL(pretend,    config->args, "-pretend", false);
    164165    PXOPT_LOOKUP_BOOL(simple,     config->args, "-simple", false);
     
    168169    psString dvodb_string = NULL;
    169170    psString bare_query = NULL;
     171
     172    if (!(destreaked && uncensored) && (destreaked || uncensored)) {
     173      //if one of destreaked and uncensored is true, but not both
     174      if (destreaked) {
     175      psTrace("addtool.c", PS_LOG_INFO, "using -destreaked\n");
     176      } else {
     177      psTrace("addtool.c", PS_LOG_INFO, "using -unscensored\n");
     178      }
     179    } else {
     180      if (destreaked && uncensored) {
     181        psError(PS_ERR_UNKNOWN, false, "Both -destreaked and -uncensored are selected. Please use one or the other, not both, \n");
     182        return false;
     183      }
     184      if (!destreaked && !uncensored) {
     185        psError(PS_ERR_UNKNOWN, false, "Neither -destreaked or -uncensored are selected. Please use one.\n");
     186         return false;
     187      }
     188    }
     189
     190   
     191
    170192
    171193    if (strcmp(stage,"cam") == 0 ) {
     
    240262
    241263    if (destreaked) {
     264      //This picks the magicked/censored ones
    242265      if (strcmp(stage,"cam") == 0) {
    243266        psStringAppend(&query, " AND (camRun.magicked > 0)");
     
    247270      }
    248271      // staticSky has no magicked column.
     272    } else {
     273      //This picks only the unmagicked/uncensored ones
     274      if (strcmp(stage,"cam") == 0) {
     275        psStringAppend(&query, " AND (camRun.magicked = 0)");
     276      }
     277      if (strcmp(stage,"stack") == 0) {
     278        psStringAppend(&query, " AND (stackRun.magicked = 0)");
     279      }
     280
    249281    }
    250282
  • trunk/ippTools/src/addtoolConfig.c

    r31596 r31680  
    5858    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-filter", PS_META_DUPLICATE_OK, "search by filter", NULL);
    5959    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-reduction",          0, "search by camRun reduction class", NULL);
    60     psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-destreaked",           0, "only queue destreaked runs", false);
    61 
     60    psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-destreaked",           0, "queue destreaked runs", false);
     61    psMetadataAddBool(definebyqueryArgs, PS_LIST_TAIL, "-uncensored",           0, "queue uncensored runs", false);
    6262    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_workdir",        0, "define workdir", NULL);
    6363    psMetadataAddStr(definebyqueryArgs, PS_LIST_TAIL, "-set_label",          0, "define label", NULL);
Note: See TracChangeset for help on using the changeset viewer.