Changeset 15530
- Timestamp:
- Nov 8, 2007, 4:56:46 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
-
dbconfig/warp.md (modified) (2 diffs)
-
ippdb/src/ippdb.c (modified) (9 diffs)
-
ippdb/src/ippdb.h (modified) (3 diffs)
-
ippdb/tests/alloc.c (modified) (2 diffs)
-
ippdb/tests/insert.c (modified) (1 diff)
-
ippdb/tests/insertobject.c (modified) (1 diff)
-
ippdb/tests/metadatafromobject.c (modified) (2 diffs)
-
ippdb/tests/objectfrommetadata.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dbconfig/warp.md
r15376 r15530 1 # $Id: warp.md,v 1. 7 2007-10-25 20:33:45 priceExp $1 # $Id: warp.md,v 1.8 2007-11-09 02:56:46 jhoblitt Exp $ 2 2 3 3 # … … 51 51 bg_stdev F64 0.0 52 52 good_frac F64 0.0 # Key 53 ignore BOOL f # Key 53 54 fault S16 0 # Key 54 55 END -
trunk/ippdb/src/ippdb.c
r15421 r15530 9592 9592 static void warpSkyfileRowFree(warpSkyfileRow *object); 9593 9593 9594 warpSkyfileRow *warpSkyfileRowAlloc(psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF64 good_frac, psS16 fault)9594 warpSkyfileRow *warpSkyfileRowAlloc(psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF64 good_frac, bool ignore, psS16 fault) 9595 9595 { 9596 9596 warpSkyfileRow *_object; … … 9607 9607 _object->bg_stdev = bg_stdev; 9608 9608 _object->good_frac = good_frac; 9609 _object->ignore = ignore; 9609 9610 _object->fault = fault; 9610 9611 … … 9663 9664 return false; 9664 9665 } 9666 if (!psMetadataAdd(md, PS_LIST_TAIL, "ignore", PS_DATA_BOOL, "Key", 0)) { 9667 psError(PS_ERR_UNKNOWN, false, "failed to add item ignore"); 9668 psFree(md); 9669 return false; 9670 } 9665 9671 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "Key", 0)) { 9666 9672 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); … … 9681 9687 } 9682 9688 9683 bool warpSkyfileInsert(psDB * dbh, psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF64 good_frac, psS16 fault)9689 bool warpSkyfileInsert(psDB * dbh, psS64 warp_id, const char *skycell_id, const char *tess_id, const char *uri, const char *path_base, psF64 bg, psF64 bg_stdev, psF64 good_frac, bool ignore, psS16 fault) 9684 9690 { 9685 9691 psMetadata *md = psMetadataAlloc(); … … 9721 9727 if (!psMetadataAdd(md, PS_LIST_TAIL, "good_frac", PS_DATA_F64, NULL, good_frac)) { 9722 9728 psError(PS_ERR_UNKNOWN, false, "failed to add item good_frac"); 9729 psFree(md); 9730 return false; 9731 } 9732 if (!psMetadataAdd(md, PS_LIST_TAIL, "ignore", PS_DATA_BOOL, NULL, ignore)) { 9733 psError(PS_ERR_UNKNOWN, false, "failed to add item ignore"); 9723 9734 psFree(md); 9724 9735 return false; … … 9752 9763 bool warpSkyfileInsertObject(psDB *dbh, warpSkyfileRow *object) 9753 9764 { 9754 return warpSkyfileInsert(dbh, object->warp_id, object->skycell_id, object->tess_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->good_frac, object-> fault);9765 return warpSkyfileInsert(dbh, object->warp_id, object->skycell_id, object->tess_id, object->uri, object->path_base, object->bg, object->bg_stdev, object->good_frac, object->ignore, object->fault); 9755 9766 } 9756 9767 … … 9865 9876 return false; 9866 9877 } 9878 if (!psMetadataAdd(md, PS_LIST_TAIL, "ignore", PS_DATA_BOOL, NULL, object->ignore)) { 9879 psError(PS_ERR_UNKNOWN, false, "failed to add item ignore"); 9880 psFree(md); 9881 return false; 9882 } 9867 9883 if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) { 9868 9884 psError(PS_ERR_UNKNOWN, false, "failed to add item fault"); … … 9919 9935 return false; 9920 9936 } 9937 bool ignore = psMetadataLookupBool(&status, md, "ignore"); 9938 if (!status) { 9939 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item ignore"); 9940 return false; 9941 } 9921 9942 psS16 fault = psMetadataLookupS16(&status, md, "fault"); 9922 9943 if (!status) { … … 9925 9946 } 9926 9947 9927 return warpSkyfileRowAlloc(warp_id, skycell_id, tess_id, uri, path_base, bg, bg_stdev, good_frac, fault);9948 return warpSkyfileRowAlloc(warp_id, skycell_id, tess_id, uri, path_base, bg, bg_stdev, good_frac, ignore, fault); 9928 9949 } 9929 9950 psArray *warpSkyfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) -
trunk/ippdb/src/ippdb.h
r15421 r15530 4735 4735 psF64 bg_stdev; 4736 4736 psF64 good_frac; 4737 bool ignore; 4737 4738 psS16 fault; 4738 4739 } warpSkyfileRow; … … 4752 4753 psF64 bg_stdev, 4753 4754 psF64 good_frac, 4755 bool ignore, 4754 4756 psS16 fault 4755 4757 ); … … 4790 4792 psF64 bg_stdev, 4791 4793 psF64 good_frac, 4794 bool ignore, 4792 4795 psS16 fault 4793 4796 ); -
trunk/ippdb/tests/alloc.c
r15421 r15530 1032 1032 warpSkyfileRow *object; 1033 1033 1034 object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, -16 );1034 object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, true, -16 ); 1035 1035 1036 1036 if (!object) { … … 1067 1067 } 1068 1068 if (!object->good_frac == 64.64) { 1069 psFree(object); 1070 exit(EXIT_FAILURE); 1071 } 1072 if (!object->ignore == true) { 1069 1073 psFree(object); 1070 1074 exit(EXIT_FAILURE); -
trunk/ippdb/tests/insert.c
r15421 r15530 328 328 } 329 329 330 if (!warpSkyfileInsert(dbh, -64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, -16)) {330 if (!warpSkyfileInsert(dbh, -64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, true, -16)) { 331 331 exit(EXIT_FAILURE); 332 332 } -
trunk/ippdb/tests/insertobject.c
r15421 r15530 476 476 } 477 477 478 object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, -16);478 object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, true, -16); 479 479 if (!object) { 480 480 exit(EXIT_FAILURE); -
trunk/ippdb/tests/metadatafromobject.c
r15421 r15530 1178 1178 bool status; 1179 1179 1180 object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, -16);1180 object = warpSkyfileRowAlloc(-64, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, true, -16); 1181 1181 if (!object) { 1182 1182 exit(EXIT_FAILURE); … … 1218 1218 } 1219 1219 if (!psMetadataLookupF64(&status, md, "good_frac") == 64.64) { 1220 psFree(md); 1221 exit(EXIT_FAILURE); 1222 } 1223 if (!psMetadataLookupBool(&status, md, "ignore") == true) { 1220 1224 psFree(md); 1221 1225 exit(EXIT_FAILURE); -
trunk/ippdb/tests/objectfrommetadata.c
r15421 r15530 1870 1870 exit(EXIT_FAILURE); 1871 1871 } 1872 if (!psMetadataAdd(md, PS_LIST_TAIL, "ignore", PS_DATA_BOOL, NULL, true)) { 1873 psFree(md); 1874 exit(EXIT_FAILURE); 1875 } 1872 1876 psFree(md); 1873 1877 exit(EXIT_FAILURE); … … 1910 1914 } 1911 1915 if (!object->good_frac == 64.64) { 1916 psFree(object); 1917 exit(EXIT_FAILURE); 1918 } 1919 if (!object->ignore == true) { 1912 1920 psFree(object); 1913 1921 exit(EXIT_FAILURE);
Note:
See TracChangeset
for help on using the changeset viewer.
