Changeset 13937 for trunk/ippdb
- Timestamp:
- Jun 21, 2007, 2:10:11 PM (19 years ago)
- Location:
- trunk/ippdb
- Files:
-
- 8 edited
-
configure.ac (modified) (1 diff)
-
src/ippdb.c (modified) (50 diffs)
-
src/ippdb.h (modified) (15 diffs)
-
tests/alloc.c (modified) (6 diffs)
-
tests/insert.c (modified) (1 diff)
-
tests/insertobject.c (modified) (1 diff)
-
tests/metadatafromobject.c (modified) (6 diffs)
-
tests/objectfrommetadata.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippdb/configure.ac
r13739 r13937 7 7 AC_PREREQ(2.59) 8 8 9 AC_INIT([ippdb], [1.1.2 2], [pan-starrs.ifa.hawaii.edu])9 AC_INIT([ippdb], [1.1.23], [pan-starrs.ifa.hawaii.edu]) 10 10 AC_CONFIG_SRCDIR([ippdb.pc.in]) 11 11 -
trunk/ippdb/src/ippdb.c
r13739 r13937 5541 5541 static void chipPendingExpRowFree(chipPendingExpRow *object); 5542 5542 5543 chipPendingExpRow *chipPendingExpRowAlloc(psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *re cipe, const char *expgroup, const char *dvodb)5543 chipPendingExpRow *chipPendingExpRowAlloc(psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *reduction, const char *expgroup, const char *dvodb) 5544 5544 { 5545 5545 chipPendingExpRow *_object; … … 5553 5553 _object->workdir = psStringCopy(workdir); 5554 5554 _object->label = psStringCopy(label); 5555 _object->re cipe = psStringCopy(recipe);5555 _object->reduction = psStringCopy(reduction); 5556 5556 _object->expgroup = psStringCopy(expgroup); 5557 5557 _object->dvodb = psStringCopy(dvodb); … … 5565 5565 psFree(object->workdir); 5566 5566 psFree(object->label); 5567 psFree(object->re cipe);5567 psFree(object->reduction); 5568 5568 psFree(object->expgroup); 5569 5569 psFree(object->dvodb); … … 5598 5598 return false; 5599 5599 } 5600 if (!psMetadataAdd(md, PS_LIST_TAIL, "re cipe", PS_DATA_STRING, NULL, "64")) {5601 psError(PS_ERR_UNKNOWN, false, "failed to add item re cipe");5600 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, "Reduction class", "64")) { 5601 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 5602 5602 psFree(md); 5603 5603 return false; … … 5626 5626 } 5627 5627 5628 bool chipPendingExpInsert(psDB * dbh, psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *re cipe, const char *expgroup, const char *dvodb)5628 bool chipPendingExpInsert(psDB * dbh, psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *reduction, const char *expgroup, const char *dvodb) 5629 5629 { 5630 5630 psMetadata *md = psMetadataAlloc(); … … 5654 5654 return false; 5655 5655 } 5656 if (!psMetadataAdd(md, PS_LIST_TAIL, "re cipe", PS_DATA_STRING, NULL, recipe)) {5657 psError(PS_ERR_UNKNOWN, false, "failed to add item re cipe");5656 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, reduction)) { 5657 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 5658 5658 psFree(md); 5659 5659 return false; … … 5692 5692 bool chipPendingExpInsertObject(psDB *dbh, chipPendingExpRow *object) 5693 5693 { 5694 return chipPendingExpInsert(dbh, object->chip_id, object->exp_tag, object->guide_id, object->workdir, object->label, object->re cipe, object->expgroup, object->dvodb);5694 return chipPendingExpInsert(dbh, object->chip_id, object->exp_tag, object->guide_id, object->workdir, object->label, object->reduction, object->expgroup, object->dvodb); 5695 5695 } 5696 5696 … … 5790 5790 return false; 5791 5791 } 5792 if (!psMetadataAdd(md, PS_LIST_TAIL, "re cipe", PS_DATA_STRING, NULL, object->recipe)) {5793 psError(PS_ERR_UNKNOWN, false, "failed to add item re cipe");5792 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, object->reduction)) { 5793 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 5794 5794 psFree(md); 5795 5795 return false; … … 5839 5839 return false; 5840 5840 } 5841 char* re cipe = psMetadataLookupPtr(&status, md, "recipe");5842 if (!status) { 5843 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item re cipe");5841 char* reduction = psMetadataLookupPtr(&status, md, "reduction"); 5842 if (!status) { 5843 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item reduction"); 5844 5844 return false; 5845 5845 } … … 5855 5855 } 5856 5856 5857 return chipPendingExpRowAlloc(chip_id, exp_tag, guide_id, workdir, label, re cipe, expgroup, dvodb);5857 return chipPendingExpRowAlloc(chip_id, exp_tag, guide_id, workdir, label, reduction, expgroup, dvodb); 5858 5858 } 5859 5859 psArray *chipPendingExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 6284 6284 static void chipProcessedExpRowFree(chipProcessedExpRow *object); 6285 6285 6286 chipProcessedExpRow *chipProcessedExpRowAlloc(psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *re cipe, const char *expgroup, const char *dvodb)6286 chipProcessedExpRow *chipProcessedExpRowAlloc(psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *reduction, const char *expgroup, const char *dvodb) 6287 6287 { 6288 6288 chipProcessedExpRow *_object; … … 6296 6296 _object->workdir = psStringCopy(workdir); 6297 6297 _object->label = psStringCopy(label); 6298 _object->re cipe = psStringCopy(recipe);6298 _object->reduction = psStringCopy(reduction); 6299 6299 _object->expgroup = psStringCopy(expgroup); 6300 6300 _object->dvodb = psStringCopy(dvodb); … … 6308 6308 psFree(object->workdir); 6309 6309 psFree(object->label); 6310 psFree(object->re cipe);6310 psFree(object->reduction); 6311 6311 psFree(object->expgroup); 6312 6312 psFree(object->dvodb); … … 6341 6341 return false; 6342 6342 } 6343 if (!psMetadataAdd(md, PS_LIST_TAIL, "re cipe", PS_DATA_STRING, NULL, "64")) {6344 psError(PS_ERR_UNKNOWN, false, "failed to add item re cipe");6343 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, "64")) { 6344 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 6345 6345 psFree(md); 6346 6346 return false; … … 6369 6369 } 6370 6370 6371 bool chipProcessedExpInsert(psDB * dbh, psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *re cipe, const char *expgroup, const char *dvodb)6371 bool chipProcessedExpInsert(psDB * dbh, psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *reduction, const char *expgroup, const char *dvodb) 6372 6372 { 6373 6373 psMetadata *md = psMetadataAlloc(); … … 6397 6397 return false; 6398 6398 } 6399 if (!psMetadataAdd(md, PS_LIST_TAIL, "re cipe", PS_DATA_STRING, NULL, recipe)) {6400 psError(PS_ERR_UNKNOWN, false, "failed to add item re cipe");6399 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, reduction)) { 6400 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 6401 6401 psFree(md); 6402 6402 return false; … … 6435 6435 bool chipProcessedExpInsertObject(psDB *dbh, chipProcessedExpRow *object) 6436 6436 { 6437 return chipProcessedExpInsert(dbh, object->chip_id, object->exp_tag, object->guide_id, object->workdir, object->label, object->re cipe, object->expgroup, object->dvodb);6437 return chipProcessedExpInsert(dbh, object->chip_id, object->exp_tag, object->guide_id, object->workdir, object->label, object->reduction, object->expgroup, object->dvodb); 6438 6438 } 6439 6439 … … 6533 6533 return false; 6534 6534 } 6535 if (!psMetadataAdd(md, PS_LIST_TAIL, "re cipe", PS_DATA_STRING, NULL, object->recipe)) {6536 psError(PS_ERR_UNKNOWN, false, "failed to add item re cipe");6535 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, object->reduction)) { 6536 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 6537 6537 psFree(md); 6538 6538 return false; … … 6582 6582 return false; 6583 6583 } 6584 char* re cipe = psMetadataLookupPtr(&status, md, "recipe");6585 if (!status) { 6586 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item re cipe");6584 char* reduction = psMetadataLookupPtr(&status, md, "reduction"); 6585 if (!status) { 6586 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item reduction"); 6587 6587 return false; 6588 6588 } … … 6598 6598 } 6599 6599 6600 return chipProcessedExpRowAlloc(chip_id, exp_tag, guide_id, workdir, label, re cipe, expgroup, dvodb);6600 return chipProcessedExpRowAlloc(chip_id, exp_tag, guide_id, workdir, label, reduction, expgroup, dvodb); 6601 6601 } 6602 6602 psArray *chipProcessedExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 7722 7722 static void camPendingExpRowFree(camPendingExpRow *object); 7723 7723 7724 camPendingExpRow *camPendingExpRowAlloc(psS64 cam_id, psS64 chip_id, const char *workdir, const char *label, const char *re cipe, const char *expgroup, const char *dvodb)7724 camPendingExpRow *camPendingExpRowAlloc(psS64 cam_id, psS64 chip_id, const char *workdir, const char *label, const char *reduction, const char *expgroup, const char *dvodb) 7725 7725 { 7726 7726 camPendingExpRow *_object; … … 7733 7733 _object->workdir = psStringCopy(workdir); 7734 7734 _object->label = psStringCopy(label); 7735 _object->re cipe = psStringCopy(recipe);7735 _object->reduction = psStringCopy(reduction); 7736 7736 _object->expgroup = psStringCopy(expgroup); 7737 7737 _object->dvodb = psStringCopy(dvodb); … … 7744 7744 psFree(object->workdir); 7745 7745 psFree(object->label); 7746 psFree(object->re cipe);7746 psFree(object->reduction); 7747 7747 psFree(object->expgroup); 7748 7748 psFree(object->dvodb); … … 7772 7772 return false; 7773 7773 } 7774 if (!psMetadataAdd(md, PS_LIST_TAIL, "re cipe", PS_DATA_STRING, NULL, "64")) {7775 psError(PS_ERR_UNKNOWN, false, "failed to add item re cipe");7774 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, "64")) { 7775 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 7776 7776 psFree(md); 7777 7777 return false; … … 7800 7800 } 7801 7801 7802 bool camPendingExpInsert(psDB * dbh, psS64 cam_id, psS64 chip_id, const char *workdir, const char *label, const char *re cipe, const char *expgroup, const char *dvodb)7802 bool camPendingExpInsert(psDB * dbh, psS64 cam_id, psS64 chip_id, const char *workdir, const char *label, const char *reduction, const char *expgroup, const char *dvodb) 7803 7803 { 7804 7804 psMetadata *md = psMetadataAlloc(); … … 7823 7823 return false; 7824 7824 } 7825 if (!psMetadataAdd(md, PS_LIST_TAIL, "re cipe", PS_DATA_STRING, NULL, recipe)) {7826 psError(PS_ERR_UNKNOWN, false, "failed to add item re cipe");7825 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, reduction)) { 7826 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 7827 7827 psFree(md); 7828 7828 return false; … … 7861 7861 bool camPendingExpInsertObject(psDB *dbh, camPendingExpRow *object) 7862 7862 { 7863 return camPendingExpInsert(dbh, object->cam_id, object->chip_id, object->workdir, object->label, object->re cipe, object->expgroup, object->dvodb);7863 return camPendingExpInsert(dbh, object->cam_id, object->chip_id, object->workdir, object->label, object->reduction, object->expgroup, object->dvodb); 7864 7864 } 7865 7865 … … 7954 7954 return false; 7955 7955 } 7956 if (!psMetadataAdd(md, PS_LIST_TAIL, "re cipe", PS_DATA_STRING, NULL, object->recipe)) {7957 psError(PS_ERR_UNKNOWN, false, "failed to add item re cipe");7956 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, object->reduction)) { 7957 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 7958 7958 psFree(md); 7959 7959 return false; … … 7998 7998 return false; 7999 7999 } 8000 char* re cipe = psMetadataLookupPtr(&status, md, "recipe");8001 if (!status) { 8002 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item re cipe");8000 char* reduction = psMetadataLookupPtr(&status, md, "reduction"); 8001 if (!status) { 8002 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item reduction"); 8003 8003 return false; 8004 8004 } … … 8014 8014 } 8015 8015 8016 return camPendingExpRowAlloc(cam_id, chip_id, workdir, label, re cipe, expgroup, dvodb);8016 return camPendingExpRowAlloc(cam_id, chip_id, workdir, label, reduction, expgroup, dvodb); 8017 8017 } 8018 8018 psArray *camPendingExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 8126 8126 static void camProcessedExpRowFree(camProcessedExpRow *object); 8127 8127 8128 camProcessedExpRow *camProcessedExpRowAlloc(psS64 cam_id, psS64 chip_id, const char *workdir, const char *label, const char *re cipe, const char *expgroup, const char *dvodb, const char *uri, psF32 bg, psF32 bg_stdev, psF32 bg_mean_stdev, psF32 sigma_ra, psF32 sigma_dec, psF32 zp_mean, psF32 zp_stdev, psF32 fwhm, psF32 fwhm_range, psS32 n_stars, psS32 n_extended, psS32 n_cr, psS32 n_astrom, const char *path_base, psS16 fault)8128 camProcessedExpRow *camProcessedExpRowAlloc(psS64 cam_id, psS64 chip_id, const char *workdir, const char *label, const char *reduction, const char *expgroup, const char *dvodb, const char *uri, psF32 bg, psF32 bg_stdev, psF32 bg_mean_stdev, psF32 sigma_ra, psF32 sigma_dec, psF32 zp_mean, psF32 zp_stdev, psF32 fwhm, psF32 fwhm_range, psS32 n_stars, psS32 n_extended, psS32 n_cr, psS32 n_astrom, const char *path_base, psS16 fault) 8129 8129 { 8130 8130 camProcessedExpRow *_object; … … 8137 8137 _object->workdir = psStringCopy(workdir); 8138 8138 _object->label = psStringCopy(label); 8139 _object->re cipe = psStringCopy(recipe);8139 _object->reduction = psStringCopy(reduction); 8140 8140 _object->expgroup = psStringCopy(expgroup); 8141 8141 _object->dvodb = psStringCopy(dvodb); … … 8164 8164 psFree(object->workdir); 8165 8165 psFree(object->label); 8166 psFree(object->re cipe);8166 psFree(object->reduction); 8167 8167 psFree(object->expgroup); 8168 8168 psFree(object->dvodb); … … 8194 8194 return false; 8195 8195 } 8196 if (!psMetadataAdd(md, PS_LIST_TAIL, "re cipe", PS_DATA_STRING, NULL, "64")) {8197 psError(PS_ERR_UNKNOWN, false, "failed to add item re cipe");8196 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, "64")) { 8197 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 8198 8198 psFree(md); 8199 8199 return false; … … 8302 8302 } 8303 8303 8304 bool camProcessedExpInsert(psDB * dbh, psS64 cam_id, psS64 chip_id, const char *workdir, const char *label, const char *re cipe, const char *expgroup, const char *dvodb, const char *uri, psF32 bg, psF32 bg_stdev, psF32 bg_mean_stdev, psF32 sigma_ra, psF32 sigma_dec, psF32 zp_mean, psF32 zp_stdev, psF32 fwhm, psF32 fwhm_range, psS32 n_stars, psS32 n_extended, psS32 n_cr, psS32 n_astrom, const char *path_base, psS16 fault)8304 bool camProcessedExpInsert(psDB * dbh, psS64 cam_id, psS64 chip_id, const char *workdir, const char *label, const char *reduction, const char *expgroup, const char *dvodb, const char *uri, psF32 bg, psF32 bg_stdev, psF32 bg_mean_stdev, psF32 sigma_ra, psF32 sigma_dec, psF32 zp_mean, psF32 zp_stdev, psF32 fwhm, psF32 fwhm_range, psS32 n_stars, psS32 n_extended, psS32 n_cr, psS32 n_astrom, const char *path_base, psS16 fault) 8305 8305 { 8306 8306 psMetadata *md = psMetadataAlloc(); … … 8325 8325 return false; 8326 8326 } 8327 if (!psMetadataAdd(md, PS_LIST_TAIL, "re cipe", PS_DATA_STRING, NULL, recipe)) {8328 psError(PS_ERR_UNKNOWN, false, "failed to add item re cipe");8327 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, reduction)) { 8328 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 8329 8329 psFree(md); 8330 8330 return false; … … 8443 8443 bool camProcessedExpInsertObject(psDB *dbh, camProcessedExpRow *object) 8444 8444 { 8445 return camProcessedExpInsert(dbh, object->cam_id, object->chip_id, object->workdir, object->label, object->re cipe, object->expgroup, object->dvodb, object->uri, object->bg, object->bg_stdev, object->bg_mean_stdev, object->sigma_ra, object->sigma_dec, object->zp_mean, object->zp_stdev, object->fwhm, object->fwhm_range, object->n_stars, object->n_extended, object->n_cr, object->n_astrom, object->path_base, object->fault);8445 return camProcessedExpInsert(dbh, object->cam_id, object->chip_id, object->workdir, object->label, object->reduction, object->expgroup, object->dvodb, object->uri, object->bg, object->bg_stdev, object->bg_mean_stdev, object->sigma_ra, object->sigma_dec, object->zp_mean, object->zp_stdev, object->fwhm, object->fwhm_range, object->n_stars, object->n_extended, object->n_cr, object->n_astrom, object->path_base, object->fault); 8446 8446 } 8447 8447 … … 8536 8536 return false; 8537 8537 } 8538 if (!psMetadataAdd(md, PS_LIST_TAIL, "re cipe", PS_DATA_STRING, NULL, object->recipe)) {8539 psError(PS_ERR_UNKNOWN, false, "failed to add item re cipe");8538 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, object->reduction)) { 8539 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 8540 8540 psFree(md); 8541 8541 return false; … … 8660 8660 return false; 8661 8661 } 8662 char* re cipe = psMetadataLookupPtr(&status, md, "recipe");8663 if (!status) { 8664 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item re cipe");8662 char* reduction = psMetadataLookupPtr(&status, md, "reduction"); 8663 if (!status) { 8664 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item reduction"); 8665 8665 return false; 8666 8666 } … … 8756 8756 } 8757 8757 8758 return camProcessedExpRowAlloc(cam_id, chip_id, workdir, label, re cipe, expgroup, dvodb, uri, bg, bg_stdev, bg_mean_stdev, sigma_ra, sigma_dec, zp_mean, zp_stdev, fwhm, fwhm_range, n_stars, n_extended, n_cr, n_astrom, path_base, fault);8758 return camProcessedExpRowAlloc(cam_id, chip_id, workdir, label, reduction, expgroup, dvodb, uri, bg, bg_stdev, bg_mean_stdev, sigma_ra, sigma_dec, zp_mean, zp_stdev, fwhm, fwhm_range, n_stars, n_extended, n_cr, n_astrom, path_base, fault); 8759 8759 } 8760 8760 psArray *camProcessedExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 12827 12827 static void detRunRowFree(detRunRow *object); 12828 12828 12829 detRunRow *detRunRowAlloc(psS64 det_id, psS32 iteration, const char *det_type, const char *mode, const char *state, const char *filelevel, const char *workdir, const char *camera, const char *telescope, const char *exp_type, const char * filter, psF32 airmass_min, psF32 airmass_max, psF32 exp_time_min, psF32 exp_time_max, psF32 ccd_temp_min, psF32 ccd_temp_max, psF64 posang_min, psF64 posang_max, psTime* registered, psTime* time_begin, psTime* time_end, psTime* use_begin, psTime* use_end, psF32 solang_min, psF32 solang_max, const char *label, psS32 parent)12829 detRunRow *detRunRowAlloc(psS64 det_id, psS32 iteration, const char *det_type, const char *mode, const char *state, const char *filelevel, const char *workdir, const char *camera, const char *telescope, const char *exp_type, const char *reduction, const char *filter, psF32 airmass_min, psF32 airmass_max, psF32 exp_time_min, psF32 exp_time_max, psF32 ccd_temp_min, psF32 ccd_temp_max, psF64 posang_min, psF64 posang_max, psTime* registered, psTime* time_begin, psTime* time_end, psTime* use_begin, psTime* use_end, psF32 solang_min, psF32 solang_max, const char *label, psS32 parent) 12830 12830 { 12831 12831 detRunRow *_object; … … 12844 12844 _object->telescope = psStringCopy(telescope); 12845 12845 _object->exp_type = psStringCopy(exp_type); 12846 _object->reduction = psStringCopy(reduction); 12846 12847 _object->filter = psStringCopy(filter); 12847 12848 _object->airmass_min = airmass_min; … … 12876 12877 psFree(object->telescope); 12877 12878 psFree(object->exp_type); 12879 psFree(object->reduction); 12878 12880 psFree(object->filter); 12879 12881 psFree(object->registered); … … 12938 12940 return false; 12939 12941 } 12942 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, "Reduction clas", "64")) { 12943 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 12944 psFree(md); 12945 return false; 12946 } 12940 12947 if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, "64")) { 12941 12948 psError(PS_ERR_UNKNOWN, false, "failed to add item filter"); … … 13041 13048 } 13042 13049 13043 bool detRunInsert(psDB * dbh, psS64 det_id, psS32 iteration, const char *det_type, const char *mode, const char *state, const char *filelevel, const char *workdir, const char *camera, const char *telescope, const char *exp_type, const char * filter, psF32 airmass_min, psF32 airmass_max, psF32 exp_time_min, psF32 exp_time_max, psF32 ccd_temp_min, psF32 ccd_temp_max, psF64 posang_min, psF64 posang_max, psTime* registered, psTime* time_begin, psTime* time_end, psTime* use_begin, psTime* use_end, psF32 solang_min, psF32 solang_max, const char *label, psS32 parent)13050 bool detRunInsert(psDB * dbh, psS64 det_id, psS32 iteration, const char *det_type, const char *mode, const char *state, const char *filelevel, const char *workdir, const char *camera, const char *telescope, const char *exp_type, const char *reduction, const char *filter, psF32 airmass_min, psF32 airmass_max, psF32 exp_time_min, psF32 exp_time_max, psF32 ccd_temp_min, psF32 ccd_temp_max, psF64 posang_min, psF64 posang_max, psTime* registered, psTime* time_begin, psTime* time_end, psTime* use_begin, psTime* use_end, psF32 solang_min, psF32 solang_max, const char *label, psS32 parent) 13044 13051 { 13045 13052 psMetadata *md = psMetadataAlloc(); … … 13091 13098 if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_type", PS_DATA_STRING, NULL, exp_type)) { 13092 13099 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_type"); 13100 psFree(md); 13101 return false; 13102 } 13103 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, reduction)) { 13104 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 13093 13105 psFree(md); 13094 13106 return false; … … 13207 13219 bool detRunInsertObject(psDB *dbh, detRunRow *object) 13208 13220 { 13209 return detRunInsert(dbh, object->det_id, object->iteration, object->det_type, object->mode, object->state, object->filelevel, object->workdir, object->camera, object->telescope, object->exp_type, object-> filter, object->airmass_min, object->airmass_max, object->exp_time_min, object->exp_time_max, object->ccd_temp_min, object->ccd_temp_max, object->posang_min, object->posang_max, object->registered, object->time_begin, object->time_end, object->use_begin, object->use_end, object->solang_min, object->solang_max, object->label, object->parent);13221 return detRunInsert(dbh, object->det_id, object->iteration, object->det_type, object->mode, object->state, object->filelevel, object->workdir, object->camera, object->telescope, object->exp_type, object->reduction, object->filter, object->airmass_min, object->airmass_max, object->exp_time_min, object->exp_time_max, object->ccd_temp_min, object->ccd_temp_max, object->posang_min, object->posang_max, object->registered, object->time_begin, object->time_end, object->use_begin, object->use_end, object->solang_min, object->solang_max, object->label, object->parent); 13210 13222 } 13211 13223 … … 13330 13342 return false; 13331 13343 } 13344 if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, object->reduction)) { 13345 psError(PS_ERR_UNKNOWN, false, "failed to add item reduction"); 13346 psFree(md); 13347 return false; 13348 } 13332 13349 if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, object->filter)) { 13333 13350 psError(PS_ERR_UNKNOWN, false, "failed to add item filter"); … … 13479 13496 return false; 13480 13497 } 13498 char* reduction = psMetadataLookupPtr(&status, md, "reduction"); 13499 if (!status) { 13500 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item reduction"); 13501 return false; 13502 } 13481 13503 char* filter = psMetadataLookupPtr(&status, md, "filter"); 13482 13504 if (!status) { … … 13570 13592 } 13571 13593 13572 return detRunRowAlloc(det_id, iteration, det_type, mode, state, filelevel, workdir, camera, telescope, exp_type, filter, airmass_min, airmass_max, exp_time_min, exp_time_max, ccd_temp_min, ccd_temp_max, posang_min, posang_max, registered, time_begin, time_end, use_begin, use_end, solang_min, solang_max, label, parent);13594 return detRunRowAlloc(det_id, iteration, det_type, mode, state, filelevel, workdir, camera, telescope, exp_type, reduction, filter, airmass_min, airmass_max, exp_time_min, exp_time_max, ccd_temp_min, ccd_temp_max, posang_min, posang_max, registered, time_begin, time_end, use_begin, use_end, solang_min, solang_max, label, parent); 13573 13595 } 13574 13596 psArray *detRunSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) -
trunk/ippdb/src/ippdb.h
r13739 r13937 2755 2755 char *workdir; 2756 2756 char *label; 2757 char *re cipe;2757 char *reduction; 2758 2758 char *expgroup; 2759 2759 char *dvodb; … … 2771 2771 const char *workdir, 2772 2772 const char *label, 2773 const char *re cipe,2773 const char *reduction, 2774 2774 const char *expgroup, 2775 2775 const char *dvodb … … 2808 2808 const char *workdir, 2809 2809 const char *label, 2810 const char *re cipe,2810 const char *reduction, 2811 2811 const char *expgroup, 2812 2812 const char *dvodb … … 3172 3172 char *workdir; 3173 3173 char *label; 3174 char *re cipe;3174 char *reduction; 3175 3175 char *expgroup; 3176 3176 char *dvodb; … … 3188 3188 const char *workdir, 3189 3189 const char *label, 3190 const char *re cipe,3190 const char *reduction, 3191 3191 const char *expgroup, 3192 3192 const char *dvodb … … 3225 3225 const char *workdir, 3226 3226 const char *label, 3227 const char *re cipe,3227 const char *reduction, 3228 3228 const char *expgroup, 3229 3229 const char *dvodb … … 3843 3843 char *workdir; 3844 3844 char *label; 3845 char *re cipe;3845 char *reduction; 3846 3846 char *expgroup; 3847 3847 char *dvodb; … … 3858 3858 const char *workdir, 3859 3859 const char *label, 3860 const char *re cipe,3860 const char *reduction, 3861 3861 const char *expgroup, 3862 3862 const char *dvodb … … 3894 3894 const char *workdir, 3895 3895 const char *label, 3896 const char *re cipe,3896 const char *reduction, 3897 3897 const char *expgroup, 3898 3898 const char *dvodb … … 4056 4056 char *workdir; 4057 4057 char *label; 4058 char *re cipe;4058 char *reduction; 4059 4059 char *expgroup; 4060 4060 char *dvodb; … … 4087 4087 const char *workdir, 4088 4088 const char *label, 4089 const char *re cipe,4089 const char *reduction, 4090 4090 const char *expgroup, 4091 4091 const char *dvodb, … … 4139 4139 const char *workdir, 4140 4140 const char *label, 4141 const char *re cipe,4141 const char *reduction, 4142 4142 const char *expgroup, 4143 4143 const char *dvodb, … … 6600 6600 char *telescope; 6601 6601 char *exp_type; 6602 char *reduction; 6602 6603 char *filter; 6603 6604 psF32 airmass_min; … … 6636 6637 const char *telescope, 6637 6638 const char *exp_type, 6639 const char *reduction, 6638 6640 const char *filter, 6639 6641 psF32 airmass_min, … … 6693 6695 const char *telescope, 6694 6696 const char *exp_type, 6697 const char *reduction, 6695 6698 const char *filter, 6696 6699 psF32 airmass_min, -
trunk/ippdb/tests/alloc.c
r13739 r13937 610 610 exit(EXIT_FAILURE); 611 611 } 612 if (strncmp(object->re cipe, "a string", MAX_STRING_LENGTH)) {612 if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) { 613 613 psFree(object); 614 614 exit(EXIT_FAILURE); … … 680 680 exit(EXIT_FAILURE); 681 681 } 682 if (strncmp(object->re cipe, "a string", MAX_STRING_LENGTH)) {682 if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) { 683 683 psFree(object); 684 684 exit(EXIT_FAILURE); … … 843 843 exit(EXIT_FAILURE); 844 844 } 845 if (strncmp(object->re cipe, "a string", MAX_STRING_LENGTH)) {845 if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) { 846 846 psFree(object); 847 847 exit(EXIT_FAILURE); … … 884 884 exit(EXIT_FAILURE); 885 885 } 886 if (strncmp(object->re cipe, "a string", MAX_STRING_LENGTH)) {886 if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) { 887 887 psFree(object); 888 888 exit(EXIT_FAILURE); … … 1327 1327 detRunRow *object; 1328 1328 1329 object = detRunRowAlloc(-64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32 );1329 object = detRunRowAlloc(-64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32 ); 1330 1330 1331 1331 if (!object) { … … 1370 1370 } 1371 1371 if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) { 1372 psFree(object); 1373 exit(EXIT_FAILURE); 1374 } 1375 if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) { 1372 1376 psFree(object); 1373 1377 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insert.c
r13739 r13937 463 463 } 464 464 465 if (!detRunInsert(dbh, -64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32)) {465 if (!detRunInsert(dbh, -64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32)) { 466 466 exit(EXIT_FAILURE); 467 467 } -
trunk/ippdb/tests/insertobject.c
r13739 r13937 674 674 } 675 675 676 object = detRunRowAlloc(-64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32);676 object = detRunRowAlloc(-64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32); 677 677 if (!object) { 678 678 exit(EXIT_FAILURE); -
trunk/ippdb/tests/metadatafromobject.c
r13739 r13937 708 708 exit(EXIT_FAILURE); 709 709 } 710 if (strncmp(psMetadataLookupPtr(&status, md, "re cipe"), "a string", MAX_STRING_LENGTH)) {710 if (strncmp(psMetadataLookupPtr(&status, md, "reduction"), "a string", MAX_STRING_LENGTH)) { 711 711 psFree(md); 712 712 exit(EXIT_FAILURE); … … 791 791 exit(EXIT_FAILURE); 792 792 } 793 if (strncmp(psMetadataLookupPtr(&status, md, "re cipe"), "a string", MAX_STRING_LENGTH)) {793 if (strncmp(psMetadataLookupPtr(&status, md, "reduction"), "a string", MAX_STRING_LENGTH)) { 794 794 psFree(md); 795 795 exit(EXIT_FAILURE); … … 974 974 exit(EXIT_FAILURE); 975 975 } 976 if (strncmp(psMetadataLookupPtr(&status, md, "re cipe"), "a string", MAX_STRING_LENGTH)) {976 if (strncmp(psMetadataLookupPtr(&status, md, "reduction"), "a string", MAX_STRING_LENGTH)) { 977 977 psFree(md); 978 978 exit(EXIT_FAILURE); … … 1021 1021 exit(EXIT_FAILURE); 1022 1022 } 1023 if (strncmp(psMetadataLookupPtr(&status, md, "re cipe"), "a string", MAX_STRING_LENGTH)) {1023 if (strncmp(psMetadataLookupPtr(&status, md, "reduction"), "a string", MAX_STRING_LENGTH)) { 1024 1024 psFree(md); 1025 1025 exit(EXIT_FAILURE); … … 1538 1538 bool status; 1539 1539 1540 object = detRunRowAlloc(-64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32);1540 object = detRunRowAlloc(-64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32); 1541 1541 if (!object) { 1542 1542 exit(EXIT_FAILURE); … … 1586 1586 } 1587 1587 if (strncmp(psMetadataLookupPtr(&status, md, "exp_type"), "a string", MAX_STRING_LENGTH)) { 1588 psFree(md); 1589 exit(EXIT_FAILURE); 1590 } 1591 if (strncmp(psMetadataLookupPtr(&status, md, "reduction"), "a string", MAX_STRING_LENGTH)) { 1588 1592 psFree(md); 1589 1593 exit(EXIT_FAILURE); -
trunk/ippdb/tests/objectfrommetadata.c
r13739 r13937 1073 1073 exit(EXIT_FAILURE); 1074 1074 } 1075 if (!psMetadataAddStr(md, PS_LIST_TAIL, "re cipe", 0, NULL, "a string")) {1075 if (!psMetadataAddStr(md, PS_LIST_TAIL, "reduction", 0, NULL, "a string")) { 1076 1076 psFree(md); 1077 1077 exit(EXIT_FAILURE); … … 1112 1112 exit(EXIT_FAILURE); 1113 1113 } 1114 if (strncmp(object->re cipe, "a string", MAX_STRING_LENGTH)) {1114 if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) { 1115 1115 psFree(object); 1116 1116 exit(EXIT_FAILURE); … … 1191 1191 exit(EXIT_FAILURE); 1192 1192 } 1193 if (!psMetadataAddStr(md, PS_LIST_TAIL, "re cipe", 0, NULL, "a string")) {1193 if (!psMetadataAddStr(md, PS_LIST_TAIL, "reduction", 0, NULL, "a string")) { 1194 1194 psFree(md); 1195 1195 exit(EXIT_FAILURE); … … 1230 1230 exit(EXIT_FAILURE); 1231 1231 } 1232 if (strncmp(object->re cipe, "a string", MAX_STRING_LENGTH)) {1232 if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) { 1233 1233 psFree(object); 1234 1234 exit(EXIT_FAILURE); … … 1489 1489 exit(EXIT_FAILURE); 1490 1490 } 1491 if (!psMetadataAddStr(md, PS_LIST_TAIL, "re cipe", 0, NULL, "a string")) {1491 if (!psMetadataAddStr(md, PS_LIST_TAIL, "reduction", 0, NULL, "a string")) { 1492 1492 psFree(md); 1493 1493 exit(EXIT_FAILURE); … … 1524 1524 exit(EXIT_FAILURE); 1525 1525 } 1526 if (strncmp(object->re cipe, "a string", MAX_STRING_LENGTH)) {1526 if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) { 1527 1527 psFree(object); 1528 1528 exit(EXIT_FAILURE); … … 1559 1559 exit(EXIT_FAILURE); 1560 1560 } 1561 if (!psMetadataAddStr(md, PS_LIST_TAIL, "re cipe", 0, NULL, "a string")) {1561 if (!psMetadataAddStr(md, PS_LIST_TAIL, "reduction", 0, NULL, "a string")) { 1562 1562 psFree(md); 1563 1563 exit(EXIT_FAILURE); … … 1657 1657 exit(EXIT_FAILURE); 1658 1658 } 1659 if (strncmp(object->re cipe, "a string", MAX_STRING_LENGTH)) {1659 if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) { 1660 1660 psFree(object); 1661 1661 exit(EXIT_FAILURE); … … 2382 2382 exit(EXIT_FAILURE); 2383 2383 } 2384 if (!psMetadataAddStr(md, PS_LIST_TAIL, "reduction", 0, NULL, "a string")) { 2385 psFree(md); 2386 exit(EXIT_FAILURE); 2387 } 2384 2388 if (!psMetadataAddStr(md, PS_LIST_TAIL, "filter", 0, NULL, "a string")) { 2385 2389 psFree(md); … … 2494 2498 } 2495 2499 if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) { 2500 psFree(object); 2501 exit(EXIT_FAILURE); 2502 } 2503 if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) { 2496 2504 psFree(object); 2497 2505 exit(EXIT_FAILURE);
Note:
See TracChangeset
for help on using the changeset viewer.
