Changeset 27004 for trunk/ppStack/src/ppStack.c
- Timestamp:
- Feb 18, 2010, 6:42:01 PM (16 years ago)
- Location:
- trunk/ppStack/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src
- Property svn:ignore
-
old new 10 10 stamp-h1 11 11 ppStackVersionDefinitions.h 12 ppStackErrorCodes.c 13 ppStackErrorCodes.h
-
- Property svn:ignore
-
trunk/ppStack/src/ppStack.c
r23341 r27004 15 15 int main(int argc, char *argv[]) 16 16 { 17 ps Exit exitValue = PS_EXIT_SUCCESS; // Exit value17 psLibInit(NULL); 18 18 psTimerStart(TIMER_NAME); 19 19 psTimerStart("PPSTACK_STEPS"); 20 psLibInit(NULL);21 20 22 21 pmConfig *config = pmConfigRead(&argc, argv, PPSTACK_RECIPE); // Configuration 23 22 if (!config) { 24 psErrorStackPrint(stderr, "Error reading configuration.");25 exitValue = PS_EXIT_CONFIG_ERROR;26 goto die;27 }28 29 (void) psTraceSetLevel("ppStack", 5);30 31 if (!ppStackArgumentsSetup(argc, argv, config)) {32 psErrorStackPrint(stderr, "Error reading arguments.\n");33 exitValue = PS_EXIT_CONFIG_ERROR;34 23 goto die; 35 24 } … … 38 27 39 28 if (!pmModelClassInit()) { 40 psErrorStackPrint(stderr, "Error initialising model classes.\n"); 41 exitValue = PS_EXIT_PROG_ERROR; 29 psError(PPSTACK_ERR_PROG, false, "Unable to initialise model classes."); 42 30 goto die; 43 31 } 44 32 45 33 if (!psphotInit()) { 46 psErrorStackPrint(stderr, "Error initialising psphot.\n"); 47 exitValue = PS_EXIT_PROG_ERROR; 34 psError(PPSTACK_ERR_PROG, false, "Error initialising psphot."); 35 goto die; 36 } 37 38 (void)psTraceSetLevel("ppStack", 5); 39 40 if (!ppStackArgumentsSetup(argc, argv, config)) { 48 41 goto die; 49 42 } 50 43 51 44 if (!ppStackCamera(config)) { 52 psErrorStackPrint(stderr, "Error setting up input files.\n");53 exitValue = PS_EXIT_CONFIG_ERROR;54 45 goto die; 55 46 } 56 47 57 48 if (!ppStackArgumentsParse(config)) { 58 psErrorStackPrint(stderr, "Error reading arguments.\n");59 exitValue = PS_EXIT_CONFIG_ERROR;60 49 goto die; 61 50 } 62 51 63 52 if (!ppStackLoop(config)) { 64 psErrorStackPrint(stderr, "Error performing combination.\n");65 exitValue = PS_EXIT_DATA_ERROR;66 53 goto die; 67 54 } … … 78 65 psLibFinalize(); 79 66 pmVisualClose(); 67 68 psExit exitValue = PS_EXIT_SUCCESS; // Exit value for program 69 psErrorCode errorCode = psErrorCodeLast(); // Error code 70 if (errorCode != PS_ERR_NONE) { 71 psErrorStackPrint(stderr, "Unable to perform stack."); 72 switch (errorCode) { 73 case PPSTACK_ERR_UNKNOWN: 74 case PS_ERR_UNKNOWN: 75 exitValue = PS_EXIT_UNKNOWN_ERROR; 76 break; 77 case PS_ERR_IO: 78 case PS_ERR_DB_CLIENT: 79 case PS_ERR_DB_SERVER: 80 case PS_ERR_BAD_FITS: 81 case PS_ERR_OS_CALL_FAILED: 82 case PPSTACK_ERR_IO: 83 exitValue = PS_EXIT_SYS_ERROR; 84 break; 85 case PS_ERR_BAD_PARAMETER_VALUE: 86 case PS_ERR_BAD_PARAMETER_TYPE: 87 case PS_ERR_BAD_PARAMETER_NULL: 88 case PS_ERR_BAD_PARAMETER_SIZE: 89 case PPSTACK_ERR_ARGUMENTS: 90 case PPSTACK_ERR_CONFIG: 91 exitValue = PS_EXIT_CONFIG_ERROR; 92 break; 93 case PPSTACK_ERR_PSF: 94 case PPSTACK_ERR_REJECTED: 95 case PPSTACK_ERR_DATA: 96 exitValue = PS_EXIT_DATA_ERROR; 97 break; 98 case PS_ERR_UNEXPECTED_NULL: 99 case PS_ERR_PROGRAMMING: 100 case PPSTACK_ERR_NOT_IMPLEMENTED: 101 case PPSTACK_ERR_PROG: 102 default: 103 // It's a programming error if we're not dealing with the error correctly 104 exitValue = PS_EXIT_PROG_ERROR; 105 break; 106 } 107 } 108 80 109 exit(exitValue); 81 110 }
Note:
See TracChangeset
for help on using the changeset viewer.
