Changeset 16242
- Timestamp:
- Jan 25, 2008, 2:41:18 PM (18 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 added
- 3 edited
-
Makefile.am (modified) (2 diffs)
-
camtool.c (modified) (4 diffs)
-
pxwarp.c (added)
-
pxwarp.h (added)
-
warptool.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/Makefile.am
r15783 r16242 31 31 pxtools.h \ 32 32 pxtoolsErrorCodes.h \ 33 pxtree.h 33 pxtree.h \ 34 pxwarp.h 34 35 35 36 noinst_HEADERS = \ … … 56 57 libpxtools_la_LDFLAGS = -release $(PACKAGE_VERSION) 57 58 libpxtools_la_SOURCES = \ 59 pxcam.c \ 60 pxchip.c \ 61 pxconfig.c \ 62 pxdata.c \ 63 pxerrors.c \ 64 pxfault.c \ 65 pxio.c \ 66 pxregister.c \ 67 pxtables.c \ 68 pxtag.c \ 58 69 pxtoolsErrorCodes.c \ 59 pxerrors.c \60 pxconfig.c \61 pxfault.c \62 pxtables.c \63 pxdata.c \64 pxio.c \65 pxtag.c \66 pxregister.c \67 pxchip.c \68 70 pxtree.c \ 69 px cam.c71 pxwarp.c 70 72 71 73 # for pxtools.h -
trunk/ippTools/src/camtool.c
r16170 r16242 27 27 28 28 #include "pxtools.h" 29 #include "pxwarp.h" 29 30 #include "camtool.h" 30 31 … … 485 486 code 486 487 ); 487 psFree(pendingRow);488 488 489 489 if (!camProcessedExpInsertObject(config->dbh, row)) { … … 494 494 psError(PS_ERR_UNKNOWN, false, "database error"); 495 495 psFree(row); 496 psFree(pendingRow); 496 497 return false; 497 498 } … … 501 502 psError(PS_ERR_UNKNOWN, false, "failed to change camRun.state for cam_id: %" PRId64, row->cam_id); 502 503 psFree(row); 503 return false; 504 } 505 504 psFree(pendingRow); 505 return false; 506 } 507 508 // should we stop here or proceed on to the warp stage? 509 // NULL for end_stage means go as far as possible 510 // we can't start a warp run unlesss tess_id is defined 511 if ((pendingRow->end_stage && psStrcasestr(pendingRow->end_stage, "cam")) 512 || pendingRow->tess_id == NULL) { 513 psFree(row); 514 psFree(pendingRow); 515 if (!psDBCommit(config->dbh)) { 516 psError(PS_ERR_UNKNOWN, false, "database error"); 517 return false; 518 } 519 520 return true; 521 } 506 522 psFree(row); 523 // else continue on... 524 525 if (!pxwarpQueueByCamID(config, 526 pendingRow->cam_id, 527 pendingRow->workdir, 528 pendingRow->dvodb, 529 pendingRow->tess_id, 530 pendingRow->end_stage 531 )) { 532 // rollback 533 if (!psDBRollback(config->dbh)) { 534 psError(PS_ERR_UNKNOWN, false, "database error"); 535 } 536 psError(PS_ERR_UNKNOWN, false, "failed to queue new warpRun"); 537 psFree(pendingRow); 538 return false; 539 } 540 psFree(pendingRow); 507 541 508 542 if (!psDBCommit(config->dbh)) { -
trunk/ippTools/src/warptool.c
r16170 r16242 30 30 #include "pxtools.h" 31 31 #include "warptool.h" 32 #include "pxwarp.h" 32 33 33 34 static psS64 definerunMode(pxConfig *config); … … 46 47 47 48 static bool parseAndInsertSkyCellMap(pxConfig *config, const char *mapfile); 48 static bool setwarpRunState(pxConfig *config, psS64 warp_id, const char *state);49 49 static bool isValidMode(pxConfig *config, const char *mode); 50 50 bool warpCompletedRuns(pxConfig *config); … … 200 200 return false; 201 201 } 202 if (! setwarpRunState(config, warp_id, "run")) {202 if (!pxwarpRunSetState(config, warp_id, "run")) { 203 203 // rollback 204 204 if (!psDBRollback(config->dbh)) { … … 227 227 if (state) { 228 228 // set detRun.state to state 229 return setwarpRunState(config, (psS64)atoll(warp_id), state);229 return pxwarpRunSetState(config, (psS64)atoll(warp_id), state); 230 230 } 231 231 … … 999 999 1000 1000 1001 static bool setwarpRunState(pxConfig *config, psS64 warp_id, const char *state)1002 {1003 PS_ASSERT_PTR_NON_NULL(state, false);1004 1005 // check that state is a valid string value1006 if (!(1007 (strncmp(state, "run", 4) == 0)1008 || (strncmp(state, "stop", 5) == 0)1009 || (strncmp(state, "reg", 4) == 0)1010 )1011 ) {1012 psError(PS_ERR_UNKNOWN, false,1013 "invalid warpRun state: %s", state);1014 return false;1015 }1016 1017 char *query = "UPDATE warpRun SET state = '%s' WHERE warp_id = %" PRId64;1018 if (!p_psDBRunQuery(config->dbh, query, state, warp_id)) {1019 psError(PS_ERR_UNKNOWN, false,1020 "failed to change state for warp_id %" PRId64, warp_id);1021 return false;1022 }1023 1024 return true;1025 }1026 1027 1028 1001 static bool isValidMode(pxConfig *config, const char *mode) 1029 1002 {
Note:
See TracChangeset
for help on using the changeset viewer.
