IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 18, 2007, 2:14:55 PM (19 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.76

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/src/ippdb.c

    r11113 r11136  
    27992799static void newExpRowFree(newExpRow *object);
    28002800
    2801 newExpRow *newExpRowAlloc(const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, psS32 imfiles)
     2801newExpRow *newExpRowAlloc(const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, psS32 imfiles, const char *workdir)
    28022802{
    28032803    newExpRow       *_object;
     
    28132813    _object->exp_type = psStringCopy(exp_type);
    28142814    _object->imfiles = imfiles;
     2815    _object->workdir = psStringCopy(workdir);
    28152816
    28162817    return _object;
     
    28252826    psFree(object->dateobs);
    28262827    psFree(object->exp_type);
     2828    psFree(object->workdir);
    28272829}
    28282830
     
    28652867        return false;
    28662868    }
     2869    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, "destination for output files", "255")) {
     2870        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
     2871        psFree(md);
     2872        return false;
     2873    }
    28672874
    28682875    bool status = psDBCreateTable(dbh, NEWEXP_TABLE_NAME, md);
     
    28782885}
    28792886
    2880 bool newExpInsert(psDB * dbh, const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, psS32 imfiles)
     2887bool newExpInsert(psDB * dbh, const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, psS32 imfiles, const char *workdir)
    28812888{
    28822889    psMetadata *md = psMetadataAlloc();
     
    29132920    if (!psMetadataAdd(md, PS_LIST_TAIL, "imfiles", PS_DATA_S32, NULL, imfiles)) {
    29142921        psError(PS_ERR_UNKNOWN, false, "failed to add item imfiles");
     2922        psFree(md);
     2923        return false;
     2924    }
     2925    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, workdir)) {
     2926        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
    29152927        psFree(md);
    29162928        return false;
     
    29392951bool newExpInsertObject(psDB *dbh, newExpRow *object)
    29402952{
    2941     return newExpInsert(dbh, object->exp_tag, object->exp_id, object->camera, object->telescope, object->dateobs, object->exp_type, object->imfiles);
     2953    return newExpInsert(dbh, object->exp_tag, object->exp_id, object->camera, object->telescope, object->dateobs, object->exp_type, object->imfiles, object->workdir);
    29422954}
    29432955
     
    30473059        return false;
    30483060    }
     3061    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, object->workdir)) {
     3062        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
     3063        psFree(md);
     3064        return false;
     3065    }
    30493066
    30503067
     
    30913108        return false;
    30923109    }
    3093 
    3094     return newExpRowAlloc(exp_tag, exp_id, camera, telescope, dateobs, exp_type, imfiles);
     3110    char* workdir = psMetadataLookupPtr(&status, md, "workdir");
     3111    if (!status) {
     3112        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item workdir");
     3113        return false;
     3114    }
     3115
     3116    return newExpRowAlloc(exp_tag, exp_id, camera, telescope, dateobs, exp_type, imfiles, workdir);
    30953117}
    30963118psArray *newExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    35443566static void rawExpRowFree(rawExpRow *object);
    35453567
    3546 rawExpRow *rawExpRowAlloc(const char *exp_tag, const char *camera, const char *telescope, const char *exp_type, psS32 imfiles, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *object, psTime* dateobs, psS16 fault)
     3568rawExpRow *rawExpRowAlloc(const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, psS32 imfiles, const char *workdir, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *object, psS16 fault)
    35473569{
    35483570    rawExpRow       *_object;
     
    35523574
    35533575    _object->exp_tag = psStringCopy(exp_tag);
     3576    _object->exp_id = psStringCopy(exp_id);
    35543577    _object->camera = psStringCopy(camera);
    35553578    _object->telescope = psStringCopy(telescope);
     3579    _object->dateobs = psTimeCopy(dateobs);
    35563580    _object->exp_type = psStringCopy(exp_type);
    35573581    _object->imfiles = imfiles;
     3582    _object->workdir = psStringCopy(workdir);
    35583583    _object->filter = psStringCopy(filter);
    35593584    _object->airmass = airmass;
     
    35693594    _object->posang = posang;
    35703595    _object->object = psStringCopy(object);
    3571     _object->dateobs = psTimeCopy(dateobs);
    35723596    _object->fault = fault;
    35733597
     
    35783602{
    35793603    psFree(object->exp_tag);
     3604    psFree(object->exp_id);
    35803605    psFree(object->camera);
    35813606    psFree(object->telescope);
     3607    psFree(object->dateobs);
    35823608    psFree(object->exp_type);
     3609    psFree(object->workdir);
    35833610    psFree(object->filter);
    35843611    psFree(object->object);
    3585     psFree(object->dateobs);
    35863612}
    35873613
     
    35943620        return false;
    35953621    }
     3622    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_STRING, "Key", "64")) {
     3623        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
     3624        psFree(md);
     3625        return false;
     3626    }
    35963627    if (!psMetadataAdd(md, PS_LIST_TAIL, "camera", PS_DATA_STRING, NULL, "64")) {
    35973628        psError(PS_ERR_UNKNOWN, false, "failed to add item camera");
     
    36043635        return false;
    36053636    }
     3637    if (!psMetadataAdd(md, PS_LIST_TAIL, "dateobs", PS_DATA_TIME, NULL, NULL)) {
     3638        psError(PS_ERR_UNKNOWN, false, "failed to add item dateobs");
     3639        psFree(md);
     3640        return false;
     3641    }
    36063642    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_type", PS_DATA_STRING, NULL, "64")) {
    36073643        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_type");
     
    36143650        return false;
    36153651    }
     3652    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, "destination for output files", "255")) {
     3653        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
     3654        psFree(md);
     3655        return false;
     3656    }
    36163657    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, "64")) {
    36173658        psError(PS_ERR_UNKNOWN, false, "failed to add item filter");
     
    36793720        return false;
    36803721    }
    3681     if (!psMetadataAdd(md, PS_LIST_TAIL, "dateobs", PS_DATA_TIME, NULL, NULL)) {
    3682         psError(PS_ERR_UNKNOWN, false, "failed to add item dateobs");
    3683         psFree(md);
    3684         return false;
    3685     }
    36863722    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
    36873723        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     
    37023738}
    37033739
    3704 bool rawExpInsert(psDB * dbh, const char *exp_tag, const char *camera, const char *telescope, const char *exp_type, psS32 imfiles, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *object, psTime* dateobs, psS16 fault)
     3740bool rawExpInsert(psDB * dbh, const char *exp_tag, const char *exp_id, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, psS32 imfiles, const char *workdir, const char *filter, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, const char *object, psS16 fault)
    37053741{
    37063742    psMetadata *md = psMetadataAlloc();
     
    37103746        return false;
    37113747    }
     3748    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_STRING, NULL, exp_id)) {
     3749        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
     3750        psFree(md);
     3751        return false;
     3752    }
    37123753    if (!psMetadataAdd(md, PS_LIST_TAIL, "camera", PS_DATA_STRING, NULL, camera)) {
    37133754        psError(PS_ERR_UNKNOWN, false, "failed to add item camera");
     
    37203761        return false;
    37213762    }
     3763    if (!psMetadataAdd(md, PS_LIST_TAIL, "dateobs", PS_DATA_TIME, NULL, dateobs)) {
     3764        psError(PS_ERR_UNKNOWN, false, "failed to add item dateobs");
     3765        psFree(md);
     3766        return false;
     3767    }
    37223768    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_type", PS_DATA_STRING, NULL, exp_type)) {
    37233769        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_type");
     
    37303776        return false;
    37313777    }
     3778    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, workdir)) {
     3779        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
     3780        psFree(md);
     3781        return false;
     3782    }
    37323783    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, filter)) {
    37333784        psError(PS_ERR_UNKNOWN, false, "failed to add item filter");
     
    37923843    if (!psMetadataAdd(md, PS_LIST_TAIL, "object", PS_DATA_STRING, NULL, object)) {
    37933844        psError(PS_ERR_UNKNOWN, false, "failed to add item object");
    3794         psFree(md);
    3795         return false;
    3796     }
    3797     if (!psMetadataAdd(md, PS_LIST_TAIL, "dateobs", PS_DATA_TIME, NULL, dateobs)) {
    3798         psError(PS_ERR_UNKNOWN, false, "failed to add item dateobs");
    37993845        psFree(md);
    38003846        return false;
     
    38283874bool rawExpInsertObject(psDB *dbh, rawExpRow *object)
    38293875{
    3830     return rawExpInsert(dbh, object->exp_tag, object->camera, object->telescope, object->exp_type, object->imfiles, object->filter, object->airmass, object->ra, object->decl, object->exp_time, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->object, object->dateobs, object->fault);
     3876    return rawExpInsert(dbh, object->exp_tag, object->exp_id, object->camera, object->telescope, object->dateobs, object->exp_type, object->imfiles, object->workdir, object->filter, object->airmass, object->ra, object->decl, object->exp_time, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->object, object->fault);
    38313877}
    38323878
     
    39063952        return false;
    39073953    }
     3954    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_id", PS_DATA_STRING, NULL, object->exp_id)) {
     3955        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id");
     3956        psFree(md);
     3957        return false;
     3958    }
    39083959    if (!psMetadataAdd(md, PS_LIST_TAIL, "camera", PS_DATA_STRING, NULL, object->camera)) {
    39093960        psError(PS_ERR_UNKNOWN, false, "failed to add item camera");
     
    39163967        return false;
    39173968    }
     3969    if (!psMetadataAdd(md, PS_LIST_TAIL, "dateobs", PS_DATA_TIME, NULL, object->dateobs)) {
     3970        psError(PS_ERR_UNKNOWN, false, "failed to add item dateobs");
     3971        psFree(md);
     3972        return false;
     3973    }
    39183974    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_type", PS_DATA_STRING, NULL, object->exp_type)) {
    39193975        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_type");
     
    39263982        return false;
    39273983    }
     3984    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, object->workdir)) {
     3985        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
     3986        psFree(md);
     3987        return false;
     3988    }
    39283989    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, object->filter)) {
    39293990        psError(PS_ERR_UNKNOWN, false, "failed to add item filter");
     
    39914052        return false;
    39924053    }
    3993     if (!psMetadataAdd(md, PS_LIST_TAIL, "dateobs", PS_DATA_TIME, NULL, object->dateobs)) {
    3994         psError(PS_ERR_UNKNOWN, false, "failed to add item dateobs");
    3995         psFree(md);
    3996         return false;
    3997     }
    39984054    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
    39994055        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     
    40154071        return false;
    40164072    }
     4073    char* exp_id = psMetadataLookupPtr(&status, md, "exp_id");
     4074    if (!status) {
     4075        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item exp_id");
     4076        return false;
     4077    }
    40174078    char* camera = psMetadataLookupPtr(&status, md, "camera");
    40184079    if (!status) {
     
    40254086        return false;
    40264087    }
     4088    psTime* dateobs = psMetadataLookupPtr(&status, md, "dateobs");
     4089    if (!status) {
     4090        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item dateobs");
     4091        return false;
     4092    }
    40274093    char* exp_type = psMetadataLookupPtr(&status, md, "exp_type");
    40284094    if (!status) {
     
    40354101        return false;
    40364102    }
     4103    char* workdir = psMetadataLookupPtr(&status, md, "workdir");
     4104    if (!status) {
     4105        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item workdir");
     4106        return false;
     4107    }
    40374108    char* filter = psMetadataLookupPtr(&status, md, "filter");
    40384109    if (!status) {
     
    41004171        return false;
    41014172    }
    4102     psTime* dateobs = psMetadataLookupPtr(&status, md, "dateobs");
    4103     if (!status) {
    4104         psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item dateobs");
    4105         return false;
    4106     }
    41074173    psS16 fault = psMetadataLookupS16(&status, md, "fault");
    41084174    if (!status) {
     
    41114177    }
    41124178
    4113     return rawExpRowAlloc(exp_tag, camera, telescope, exp_type, imfiles, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, object, dateobs, fault);
     4179    return rawExpRowAlloc(exp_tag, exp_id, camera, telescope, dateobs, exp_type, imfiles, workdir, filter, airmass, ra, decl, exp_time, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, object, fault);
    41144180}
    41154181psArray *rawExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    83118377static void detRunRowFree(detRunRow *object);
    83128378
    8313 detRunRow *detRunRowAlloc(psS32 det_id, psS32 iteration, const char *det_type, const char *mode, const char *state, const char *exp_type, const char *filter, psF32 airmass, psF32 exp_time, psF32 ccd_temp, psF64 posang, const char *object, psTime* registered, psTime* use_begin, psTime* use_end)
     8379detRunRow *detRunRowAlloc(psS32 det_id, psS32 iteration, const char *det_type, const char *mode, const char *state, const char *exp_type, const char *workdir, const char *filter, psF32 airmass, psF32 exp_time, psF32 ccd_temp, psF64 posang, const char *object, psTime* registered, psTime* use_begin, psTime* use_end)
    83148380{
    83158381    detRunRow       *_object;
     
    83248390    _object->state = psStringCopy(state);
    83258391    _object->exp_type = psStringCopy(exp_type);
     8392    _object->workdir = psStringCopy(workdir);
    83268393    _object->filter = psStringCopy(filter);
    83278394    _object->airmass = airmass;
     
    83438410    psFree(object->state);
    83448411    psFree(object->exp_type);
     8412    psFree(object->workdir);
    83458413    psFree(object->filter);
    83468414    psFree(object->object);
     
    83838451        return false;
    83848452    }
     8453    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, "destination for output files", "255")) {
     8454        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
     8455        psFree(md);
     8456        return false;
     8457    }
    83858458    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, "64")) {
    83868459        psError(PS_ERR_UNKNOWN, false, "failed to add item filter");
     
    84418514}
    84428515
    8443 bool detRunInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *det_type, const char *mode, const char *state, const char *exp_type, const char *filter, psF32 airmass, psF32 exp_time, psF32 ccd_temp, psF64 posang, const char *object, psTime* registered, psTime* use_begin, psTime* use_end)
     8516bool detRunInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *det_type, const char *mode, const char *state, const char *exp_type, const char *workdir, const char *filter, psF32 airmass, psF32 exp_time, psF32 ccd_temp, psF64 posang, const char *object, psTime* registered, psTime* use_begin, psTime* use_end)
    84448517{
    84458518    psMetadata *md = psMetadataAlloc();
     
    84718544    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_type", PS_DATA_STRING, NULL, exp_type)) {
    84728545        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_type");
     8546        psFree(md);
     8547        return false;
     8548    }
     8549    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, workdir)) {
     8550        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
    84738551        psFree(md);
    84748552        return false;
     
    85428620bool detRunInsertObject(psDB *dbh, detRunRow *object)
    85438621{
    8544     return detRunInsert(dbh, object->det_id, object->iteration, object->det_type, object->mode, object->state, object->exp_type, object->filter, object->airmass, object->exp_time, object->ccd_temp, object->posang, object->object, object->registered, object->use_begin, object->use_end);
     8622    return detRunInsert(dbh, object->det_id, object->iteration, object->det_type, object->mode, object->state, object->exp_type, object->workdir, object->filter, object->airmass, object->exp_time, object->ccd_temp, object->posang, object->object, object->registered, object->use_begin, object->use_end);
    85458623}
    85468624
     
    86458723        return false;
    86468724    }
     8725    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, object->workdir)) {
     8726        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
     8727        psFree(md);
     8728        return false;
     8729    }
    86478730    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, object->filter)) {
    86488731        psError(PS_ERR_UNKNOWN, false, "failed to add item filter");
     
    87298812        return false;
    87308813    }
     8814    char* workdir = psMetadataLookupPtr(&status, md, "workdir");
     8815    if (!status) {
     8816        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item workdir");
     8817        return false;
     8818    }
    87318819    char* filter = psMetadataLookupPtr(&status, md, "filter");
    87328820    if (!status) {
     
    87758863    }
    87768864
    8777     return detRunRowAlloc(det_id, iteration, det_type, mode, state, exp_type, filter, airmass, exp_time, ccd_temp, posang, object, registered, use_begin, use_end);
     8865    return detRunRowAlloc(det_id, iteration, det_type, mode, state, exp_type, workdir, filter, airmass, exp_time, ccd_temp, posang, object, registered, use_begin, use_end);
    87788866}
    87798867psArray *detRunSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    1326613354static void p4RunRowFree(p4RunRow *object);
    1326713355
    13268 p4RunRow *p4RunRowAlloc(psS32 p4_id, const char *survey_mode, const char *state, const char *filter, const char *skycell_id, const char *tess_id, psF64 ra, psF64 decl, const char *input_ss, const char *output_ss)
     13356p4RunRow *p4RunRowAlloc(psS32 p4_id, const char *survey_mode, const char *state, const char *workdir, const char *filter, const char *skycell_id, const char *tess_id, psF64 ra, psF64 decl, const char *input_ss, const char *output_ss)
    1326913357{
    1327013358    p4RunRow        *_object;
     
    1327613364    _object->survey_mode = psStringCopy(survey_mode);
    1327713365    _object->state = psStringCopy(state);
     13366    _object->workdir = psStringCopy(workdir);
    1327813367    _object->filter = psStringCopy(filter);
    1327913368    _object->skycell_id = psStringCopy(skycell_id);
     
    1329113380    psFree(object->survey_mode);
    1329213381    psFree(object->state);
     13382    psFree(object->workdir);
    1329313383    psFree(object->filter);
    1329413384    psFree(object->skycell_id);
     
    1331613406        return false;
    1331713407    }
     13408    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, "255")) {
     13409        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
     13410        psFree(md);
     13411        return false;
     13412    }
    1331813413    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, "64")) {
    1331913414        psError(PS_ERR_UNKNOWN, false, "failed to add item filter");
     
    1336413459}
    1336513460
    13366 bool p4RunInsert(psDB * dbh, psS32 p4_id, const char *survey_mode, const char *state, const char *filter, const char *skycell_id, const char *tess_id, psF64 ra, psF64 decl, const char *input_ss, const char *output_ss)
     13461bool p4RunInsert(psDB * dbh, psS32 p4_id, const char *survey_mode, const char *state, const char *workdir, const char *filter, const char *skycell_id, const char *tess_id, psF64 ra, psF64 decl, const char *input_ss, const char *output_ss)
    1336713462{
    1336813463    psMetadata *md = psMetadataAlloc();
     
    1337913474    if (!psMetadataAdd(md, PS_LIST_TAIL, "state", PS_DATA_STRING, NULL, state)) {
    1338013475        psError(PS_ERR_UNKNOWN, false, "failed to add item state");
     13476        psFree(md);
     13477        return false;
     13478    }
     13479    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, workdir)) {
     13480        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
    1338113481        psFree(md);
    1338213482        return false;
     
    1344013540bool p4RunInsertObject(psDB *dbh, p4RunRow *object)
    1344113541{
    13442     return p4RunInsert(dbh, object->p4_id, object->survey_mode, object->state, object->filter, object->skycell_id, object->tess_id, object->ra, object->decl, object->input_ss, object->output_ss);
     13542    return p4RunInsert(dbh, object->p4_id, object->survey_mode, object->state, object->workdir, object->filter, object->skycell_id, object->tess_id, object->ra, object->decl, object->input_ss, object->output_ss);
    1344313543}
    1344413544
     
    1352813628        return false;
    1352913629    }
     13630    if (!psMetadataAdd(md, PS_LIST_TAIL, "workdir", PS_DATA_STRING, NULL, object->workdir)) {
     13631        psError(PS_ERR_UNKNOWN, false, "failed to add item workdir");
     13632        psFree(md);
     13633        return false;
     13634    }
    1353013635    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, object->filter)) {
    1353113636        psError(PS_ERR_UNKNOWN, false, "failed to add item filter");
     
    1358713692        return false;
    1358813693    }
     13694    char* workdir = psMetadataLookupPtr(&status, md, "workdir");
     13695    if (!status) {
     13696        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item workdir");
     13697        return false;
     13698    }
    1358913699    char* filter = psMetadataLookupPtr(&status, md, "filter");
    1359013700    if (!status) {
     
    1362313733    }
    1362413734
    13625     return p4RunRowAlloc(p4_id, survey_mode, state, filter, skycell_id, tess_id, ra, decl, input_ss, output_ss);
     13735    return p4RunRowAlloc(p4_id, survey_mode, state, workdir, filter, skycell_id, tess_id, ra, decl, input_ss, output_ss);
    1362613736}
    1362713737psArray *p4RunSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
Note: See TracChangeset for help on using the changeset viewer.