Changeset 6258
- Timestamp:
- Jan 30, 2006, 5:47:19 PM (20 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 5 edited
-
Makefile.am (modified) (2 diffs)
-
chiptool.c (modified) (4 diffs)
-
p2searchPendingFrames.c (modified) (1 diff)
-
pxframes.c (modified) (1 diff)
-
pxtools.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/Makefile.am
r6257 r6258 1 bin_PROGRAMS = pxadmin p 0search p2search1 bin_PROGRAMS = pxadmin p2search p0search 2 2 3 3 include_HEADERS = pxtools.h … … 12 12 p2rawToPending.c \ 13 13 p2searchPendingFrames.c \ 14 p2searchRawFrames.c \15 14 p2updatePending.c \ 16 15 pxframes.c \ 17 16 pxtables.c 18 17 19 20 18 # for pxtools.h 21 19 AM_CPPFLAGS = -I$(top_srcdir)/src$ 22 20 23 p0search_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(METADATADB_CFLAGS) $(pxtools_CFLAGS)24 p0search_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(METADATADB_LIBS) $(top_builddir)/src/libpxtools.la25 p0search_SOURCES = \26 p0search.c \27 p0searchConfig.c21 #p0search_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(METADATADB_CFLAGS) $(pxtools_CFLAGS) 22 #p0search_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(METADATADB_LIBS) $(top_builddir)/src/libpxtools.la 23 #p0search_SOURCES = \ 24 # p0search.c \ 25 # p0searchConfig.c 28 26 29 27 p2search_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(METADATADB_CFLAGS) $(pxtools_CFLAGS) -
trunk/ippTools/src/chiptool.c
r6223 r6258 51 51 static bool quickMode(pxConfig *config) 52 52 { 53 psArray *rawFrames = p2searchRawFrames(config);53 psArray *rawFrames = rawScienceFrameSearch(config); 54 54 if (!rawFrames) { 55 55 psError(PS_ERR_UNKNOWN, false, "no rawScienceFrames found"); … … 67 67 static bool defineMode(pxConfig *config) 68 68 { 69 psArray *rawFrames = p2searchRawFrames(config);69 psArray *rawFrames = rawScienceFrameSearch(config); 70 70 if (!rawFrames) { 71 71 psError(PS_ERR_UNKNOWN, false, "no rawScienceFrames found"); 72 72 return false; 73 73 } 74 psArray *pendingFrames = p2 searchPendingFrames(config);74 psArray *pendingFrames = p2PendingFrameSearch(config); 75 75 // XXX compare raw frames to pending frames and remove duplicate 76 76 // frames from the raw set. This may not be quiet right as it's … … 94 94 95 95 psFree(pendingFrames); 96 } 97 98 psArray *doneFrames = p2searchDoneFrames(config);99 if (doneFrames && (rawFrames->n > 0)) {100 for (int i = 0; i < rawFrames->n; i++) {101 rawScienceFrame *rawFrame = rawFrames->data[i];102 for (int j = 0; j < pendingFrames->n; j++) {103 p2DoneFrame *doneFrame = pendingFrames->data[j];104 if (strcmp(rawFrame->exposure->exp_id,105 doneFrame->exposure->exp_id) == 0) {106 psArrayRemove(rawFrames, rawFrame);107 // dec the counter as the array just got shorter108 // and we don't want to skip elemnts109 i--;110 break;111 } 112 } 113 } 114 115 psFree(doneFrames);96 97 psArray *doneFrames = p2searchDoneFrames(config); 98 if (doneFrames && (rawFrames->n > 0)) { 99 for (int i = 0; i < rawFrames->n; i++) { 100 rawScienceFrame *rawFrame = rawFrames->data[i]; 101 for (int j = 0; j < pendingFrames->n; j++) { 102 p2DoneFrame *doneFrame = pendingFrames->data[j]; 103 if (strcmp(rawFrame->exposure->exp_id, 104 doneFrame->exposure->exp_id) == 0) { 105 psArrayRemove(rawFrames, rawFrame); 106 // dec the counter as the array just got shorter 107 // and we don't want to skip elemnts 108 i--; 109 break; 110 } 111 } 112 } 113 114 psFree(doneFrames); 115 } 116 116 } 117 117 … … 133 133 static bool pendingMode(pxConfig *config) 134 134 { 135 psArray *pendingFrames = p2 searchPendingFrames(config);135 psArray *pendingFrames = p2PendingFrameSearch(config); 136 136 if (!pendingFrames) { 137 137 psError(PS_ERR_UNKNOWN, false, "no p2PendingFrames found"); -
trunk/ippTools/src/p2searchPendingFrames.c
r6214 r6258 2 2 3 3 // select pending frames (exposure+images) which are done/not done 4 psArray *p 2searchPendingFrames(pxConfig *config) {4 psArray *p0searchPendingFrames(pxConfig *config) { 5 5 PS_ASSERT_PTR_NON_NULL(config, NULL); 6 6 -
trunk/ippTools/src/pxframes.c
r6257 r6258 110 110 111 111 PX_FRAME_SEARCH(newFrame, newExp, newImfile); 112 PX_FRAME_SEARCH(rawScienceFrame, rawScienceExp, rawImfile); 113 PX_FRAME_SEARCH(p2PendingFrame, p2PendingExp, p2PendingImfile); -
trunk/ippTools/src/pxtools.h
r6225 r6258 14 14 # define RECIPE "PHASE2" 15 15 # define MAX_ROWS 10e9 16 17 typedef enum { 18 P0_MODE_NONE, 19 P0_MODE_PENDING, // grab from new 20 P0_MODE_UPDATE, // grab from new, create raw 21 } p0mode; 22 23 typedef struct { 24 p0mode mode; 25 psTime *start; 26 psTime *stop; 27 psMetadata *camera; 28 psDB *database; 29 psMetadata *site; 30 psMetadata *recipe; 31 psMetadata *arguments; 32 char *camera_name; 33 char *filter; 34 char *exp_id; 35 char *class; 36 char *class_id; 37 char *url; 38 psMetadata *where; 39 } p0Config; 16 40 17 41 typedef enum { … … 46 70 psMetadata *where; 47 71 } pxConfig; 72 73 typedef struct { 74 newExpRow *exposure; 75 psArray *images; 76 } newFrame; 77 78 newFrame *newFrameAlloc( 79 newExpRow *exposure, 80 psArray *images 81 ); 48 82 49 83 typedef struct { … … 83 117 84 118 psArray *p2rawToPending (pxConfig *config, psArray *rawFrames); 85 psArray *p2searchRawFrames (pxConfig *config);86 119 bool p2insertPendingFrames (pxConfig *config, psArray *rawFrames); 87 psArray *p2searchPendingFrames (pxConfig *config);88 120 bool p2writePendingImages (pxConfig *config, psArray *frames); 89 121 bool p2updatePendingFrames (pxConfig *config, psArray *pendingFrames); … … 95 127 psArray *p2searchPendingExp(pxConfig *config); 96 128 p2DoneExpRow *p2pendingToDoneExp(p2PendingExpRow *pendingExp); 129 97 130 bool rawScienceFramePrint(FILE *stream, pxConfig *config, psArray *frames); 131 psArray *rawScienceFrameSearch(pxConfig *config); 132 98 133 bool p2PendingFramePrint(FILE *stream, pxConfig *config, psArray *frames); 134 psArray *p2PendingFrameSearch(pxConfig *config);
Note:
See TracChangeset
for help on using the changeset viewer.
