IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 13, 2014, 6:00:46 PM (12 years ago)
Author:
watersc1
Message:

Fixed all the typos and mistakes, and I think this works as intended now. Seemed to be able to get the necessary information to the prepare_chip script.

File:
1 edited

Legend:

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

    r36511 r36512  
    184184
    185185  // Insert the top level run object
    186   remoteRunRow *run = remoteRunRowAlloc(0, // rem_id
     186  remoteRunRow *run = remoteRunRowAlloc(0, // remote_id
    187187                                        "new", // state
    188188                                        stage,
     
    206206    return(true);
    207207  }
    208   psS64 rem_id = psDBLastInsertID(config->dbh);
     208  psS64 remote_id = psDBLastInsertID(config->dbh);
    209209 
    210210  psArray *list = psArrayAllocEmpty(limit);
     
    213213    psS64 stage_id = psMetadataLookupS64(NULL, md, "stage_id");
    214214
    215     remoteComponentRow *comp = remoteComponentRowAlloc(rem_id,
     215    remoteComponentRow *comp = remoteComponentRowAlloc(remote_id,
    216216                                                       stage_id);
    217217    if (!comp) {
     
    260260  psMetadata *where = psMetadataAlloc();
    261261 
    262   PXOPT_COPY_S64(config->args, where, "-rem_id", "rem_id", "==");
     262  PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
    263263  PXOPT_COPY_STR(config->args, where, "-state", "state", "==");
    264264  PXOPT_COPY_STR(config->args, where, "-stage",  "stage",  "==");
     
    292292  psMetadata *where = psMetadataAlloc();
    293293
    294   PXOPT_COPY_S64(config->args, where, "-rem_id", "rem_id", "==");
     294  PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
    295295  PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    296296 
     
    313313{
    314314  PS_ASSERT_PTR_NON_NULL(config, false);
    315 
     315  PXOPT_LOOKUP_S64(remote_id,  config->args, "-remote_id",    true, false);
     316 
    316317  psMetadata *where = psMetadataAlloc();
    317318  psMetadata *values = psMetadataAlloc();
    318319
    319320  // Wheres
    320   PXOPT_COPY_S64(config->args, where, "-rem_id", "rem_id", "==");
    321   PXOPT_COPY_STR(config->args, where, "-label",  "label", "==");
    322 
     321  PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
     322 
    323323  // Values to set
     324  PXOPT_COPY_STR(config->args, values, "-set_label", "label", "==");
    324325  PXOPT_COPY_STR(config->args, values, "-set_state", "state", "==");
    325326  PXOPT_COPY_S16(config->args, values, "-fault",     "fault", "==");
    326   PXOPT_COPY_STR(config->args, values, "-set_label", "label", "==");
     327  PXOPT_COPY_S64(config->args, values, "-job_id",    "job_id", "==");
    327328
    328329  long rows = psDBUpdateRows(config->dbh, "remoteRun", where, values);
     
    340341{
    341342  PS_ASSERT_PTR_NON_NULL(config, false);
    342 
     343  PXOPT_LOOKUP_S64(remote_id,  config->args, "-remote_id",    true, false);
     344 
    343345  psMetadata *where = psMetadataAlloc();
    344346  // Wheres
    345   PXOPT_COPY_S64(config->args, where, "-rem_id", "rem_id", "==");
    346 
     347  PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
     348  psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
     349  psFree(where);
     350 
    347351  psString query = NULL;
    348352  query = pxDataGet("remotetool_updatepoll.sql");
    349353  if (!query) {
    350354    psError(PXTOOLS_ERR_SYS,false, "failed to retreive SQL statement");
    351     psFree(where);
     355    psFree(whereClause);
    352356    return(false);
    353357  }
    354358
    355   if (!p_psDBRunQueryF(config->dbh, query,where)) {
     359  if (!p_psDBRunQueryF(config->dbh, query,whereClause)) {
    356360    psError(PS_ERR_UNKNOWN, false, "database error");
    357361    psFree(query);
     362    psFree(whereClause);
    358363    return false;
    359364  }
    360365  psFree(query);
    361   psFree(where);
     366  psFree(whereClause);
    362367  return(true);
    363368}
     
    374379
    375380  // required
    376   PXOPT_COPY_S64(config->args, where, "-rem_id", "rem_id", "==");
     381  PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
    377382  PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
    378383 
     
    398403
    399404  // required
    400   PXOPT_COPY_S64(config->args, where, "-rem_id", "rem_id", "==");
     405  PXOPT_COPY_S64(config->args, where, "-remote_id", "remote_id", "==");
    401406  PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
    402407
Note: See TracChangeset for help on using the changeset viewer.