Changeset 25075
- Timestamp:
- Aug 14, 2009, 12:45:30 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm (modified) (2 diffs)
-
ippTools/src/pstamptool.c (modified) (2 diffs)
-
ippTools/src/pstamptoolConfig.c (modified) (1 diff)
-
pstamp/scripts/pstampparse.pl (modified) (11 diffs)
-
pstamp/src/pstamp.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm
r24921 r25075 22 22 $PSTAMP_SELECT_MASK 23 23 $PSTAMP_SELECT_WEIGHT 24 $PSTAMP_SUCCESS 25 $PSTAMP_SYSTEM_ERROR 26 $PSTAMP_NOT_IMPLEMENTED 27 $PSTAMP_UNKNOWN_ERROR 28 $PSTAMP_DUP_REQUEST 29 $PSTAMP_INVALID_REQUEST 30 $PSTAMP_UNKNOWN_PRODUCT 31 $PSTAMP_NO_IMAGE_MATCH 32 $PSTAMP_NOT_DESTREAKED 33 $PSTAMP_NOT_AVAILABLE 34 $PSTAMP_GONE 35 $PSTAMP_NO_JOBS_QUEUED 24 36 ); 25 37 our %EXPORT_TAGS = (standard => [@EXPORT_OK]); … … 33 45 our $PSTAMP_SELECT_MASK = 2; 34 46 our $PSTAMP_SELECT_WEIGHT = 4; 47 48 # job and request ERROR_CODE(s) 49 our $PSTAMP_SUCCESS = 0; 50 our $PSTAMP_SYSTEM_ERROR = 10; 51 our $PSTAMP_NOT_IMPLEMENTED = 11; 52 our $PSTAMP_UNKNOWN_ERROR = 12; 53 54 our $PSTAMP_DUP_REQUEST = 20; 55 our $PSTAMP_INVALID_REQUEST = 21; 56 our $PSTAMP_UNKNOWN_PRODUCT = 22; 57 our $PSTAMP_NO_IMAGE_MATCH = 23; 58 our $PSTAMP_NOT_DESTREAKED = 24; 59 our $PSTAMP_NOT_AVAILABLE = 25; 60 our $PSTAMP_GONE = 26; 61 our $PSTAMP_NO_JOBS_QUEUED = 27; 35 62 36 63 use IPC::Cmd 0.36 qw( can_run run ); -
trunk/ippTools/src/pstamptool.c
r25054 r25075 315 315 PS_ASSERT_PTR_NON_NULL(config, false); 316 316 317 PXOPT_LOOKUP_S64(req_id, config->args, "-req_id", true, false); 317 PXOPT_LOOKUP_S64(req_id, config->args, "-req_id", false, false); 318 PXOPT_LOOKUP_STR(name, config->args, "-name", false, false); 318 319 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 319 320 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 321 322 if (!req_id && !name) { 323 psError(PS_ERR_UNKNOWN, true, "-req_id or -name must be supplied"); 324 return false; 325 } 320 326 321 327 psString query = NULL; … … 342 348 } 343 349 if (!psArrayLength(output)) { 344 psTrace("pstamptool", PS_LOG_INFO, "no rows found"); 345 psFree(output); 346 return true; 350 psTrace("pstamptool", PS_LOG_INFO, "request not found"); 351 // This causes main to exit with PS_EXIT_DATA_ERROR which the script is looking for 352 psError(PXTOOLS_ERR_DATA, true, "request not found"); 353 psFree(output); 354 // we return false so that the caller can determine that a request does not exist 355 return false; 347 356 } 348 357 -
trunk/ippTools/src/pstamptoolConfig.c
r25054 r25075 75 75 // -listreq 76 76 psMetadata *listreqArgs = psMetadataAlloc(); 77 psMetadataAddS64(listreqArgs, PS_LIST_TAIL, "-req_id", 0, "define req_id (required)", 0); 77 psMetadataAddS64(listreqArgs, PS_LIST_TAIL, "-req_id", 0, "list by req_id", 0); 78 psMetadataAddStr(listreqArgs, PS_LIST_TAIL, "-name", 0, "list by name", NULL); 78 79 psMetadataAddU64(listreqArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 79 80 psMetadataAddBool(listreqArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); -
trunk/pstamp/scripts/pstampparse.pl
r25068 r25075 96 96 my_die("wrong EXTVER $extver found in $request_file_name", $PS_EXIT_PROG_ERROR) if ($extver ne "1"); 97 97 98 { 99 my $command = "$pstamptool -listreq -name $req_name"; 100 $command .= " -dbname $dbname" if $dbname; 101 $command .= " -dbserver $dbserver" if $dbserver; 102 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 103 run(command => $command, verbose => $verbose); 104 my $exitStatus = $error_code >> 8; 105 if ($success) { 106 # -listreq succeeded duplicate request name 107 insertFakeJobForRow(undef, 0, $PSTAMP_DUP_REQUEST); 108 exit 0; 109 } elsif ($exitStatus ne $PS_EXIT_DATA_ERROR) { 110 # wrong error code something else is wrong 111 my_die("$command failed", $exitStatus); 112 } 113 } 114 98 115 if ($req_id and !$no_update) { 99 116 # update the database with the request name. This will be used as the … … 152 169 if (!$proj_hash) { 153 170 print STDERR "project $project not found\n" if $verbose; 154 insertFakeJobForRow($row, 1, 46);171 insertFakeJobForRow($row, 1, $PSTAMP_UNKNOWN_PRODUCT); 155 172 $num_jobs++; 156 173 next; … … 173 190 if (!$skycenter and !$search_component) { 174 191 print STDERR "COMPONENT must be specified for pixel coordinate ROI\n" if $verbose; 175 insertFakeJobForRow($row, 1, 45);192 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 176 193 $num_jobs++; 177 194 next; … … 182 199 if (($job_type eq "stamp") and ! validROI($row)) { 183 200 print STDERR "invalid ROI for row $rownum\n" if $verbose; 184 insertFakeJobForRow($row, 1, 46);201 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 185 202 $num_jobs++; 186 203 next; … … 221 238 if (!$skycenter) { 222 239 print STDERR "center must be specified in sky coordintes for bycoord" if $verbose; 223 insertFakeJobForRow($row, 1, 46);240 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); 224 241 $num_jobs++; 225 242 next; 226 243 } 227 244 print STDERR "lookup bycoord is not yet implemented" if $verbose; 228 insertFakeJobForRow($row, 1, 47);245 insertFakeJobForRow($row, 1, $PSTAMP_NOT_IMPLEMENTED); 229 246 $num_jobs++; 230 247 next; … … 250 267 if (($mode eq "queue_jobs") and ($num_jobs eq 0)) { 251 268 print STDERR "no jobs created for $req_name\n" if $verbose; 252 insertFakeJobForRow(undef, 1, 41);269 insertFakeJobForRow(undef, 0, $PSTAMP_UNKNOWN_ERROR); 253 270 } 254 271 … … 272 289 if ( $numComponents == 0 ) { 273 290 print STDERR "no jobs for row $rownum\n" if $verbose; 274 insertFakeJobForRow($row, 1, 44);291 insertFakeJobForRow($row, 1, $PSTAMP_NO_JOBS_QUEUED); 275 292 return 1; 276 293 } … … 319 336 # for now assume yes. 320 337 321 insertFakeJobForRow($row, $job_num, 43);338 insertFakeJobForRow($row, $job_num, $PSTAMP_NOT_DESTREAKED); 322 339 323 340 next; … … 417 434 print STDERR "get_image jobs not implemented yet" if $verbose; 418 435 foreach my $row (@$rowList) { 419 insertFakeJobForRow($row, 1, 47);436 insertFakeJobForRow($row, 1, $PSTAMP_NOT_IMPLEMENTED); 420 437 $num_jobs++; 421 438 } … … 425 442 # the status back to the requestor 426 443 foreach my $row (@$rowList) { 427 insertFakeJobForRow($row, 1, 42);444 insertFakeJobForRow($row, 1, $PSTAMP_NO_IMAGE_MATCH); 428 445 $num_jobs++; 429 446 } … … 605 622 # if first row has no component all of the images will be retrieved, so 606 623 # the fact that this row has a component is ok. Fall through to return 1 607 # return 0; 624 # XXX Nope that doesn't work (yet) 625 return 0; 608 626 } 609 627 -
trunk/pstamp/src/pstamp.h
r18243 r25075 8 8 #include "pslib.h" 9 9 #include "psmodules.h" 10 // #include "psphot.h"11 // #include "psastro.h"12 // #include "ppStats.h"13 10 #include "pstampErrorCodes.h" 14 11 … … 31 28 } pspMode; 32 29 30 // error codes returned to users in results flie 31 typedef enum { 32 PSTAMP_SUCCESS = 0, 33 PSTAMP_SYSTEM_ERROR = 10, 34 PSTAMP_NOT_IMPLEMENTED = 11, 35 PSTAMP_UNKNOWN_ERROR = 12, 36 PSTAMP_DUP_REQUEST = 20, 37 PSTAMP_INVALID_REQUEST = 21, 38 PSTAMP_UNKNOWN_PRODUCT = 22, 39 PSTAMP_NO_IMAGE_MATCH = 23, 40 PSTAMP_NOT_DESTREAKED = 24, 41 PSTAMP_NOT_AVAILABLE = 25, 42 PSTAMP_GONE = 26, 43 PSTAMP_NO_JOBS_QUEUED = 27 44 } pstampJobErrors; 45 46 33 47 #define PSTAMP_SELECT_IMAGE 1 34 48 #define PSTAMP_SELECT_MASK 2 … … 44 58 #define STAMP_RESULTS_VERSION "1" 45 59 60 61 46 62 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
