Changeset 18561 for trunk/ippTools/src/regtool.c
- Timestamp:
- Jul 15, 2008, 10:30:59 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/regtool.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/regtool.c
r18402 r18561 297 297 PS_ASSERT_PTR_NON_NULL(config, false); 298 298 299 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);300 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);301 PXOPT_LOOKUP_BOOL(faulted, config->args, "-faulted", false);302 303 299 psMetadata *where = psMetadataAlloc(); 304 300 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); … … 306 302 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 307 303 304 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 305 PXOPT_LOOKUP_BOOL(faulted, config->args, "-faulted", false); 306 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 307 308 308 psString query = pxDataGet("regtool_processedimfile.sql"); 309 309 if (!query) { … … 313 313 } 314 314 315 if ( where) {315 if (psListLength(where->list)) { 316 316 psString whereClause = psDBGenerateWhereConditionSQL(where, "rawImfile"); 317 317 psStringAppend(&query, " AND %s", whereClause); … … 381 381 PS_ASSERT_PTR_NON_NULL(config, false); 382 382 383 psMetadata *where = psMetadataAlloc(); 384 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 385 PXOPT_COPY_STR(config->args, where, "-tmp_class_id", "tmp_class_id", "=="); 386 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 387 PXOPT_COPY_S16(config->args, where, "-code", "fault", "=="); 388 383 389 psString query = pxDataGet("regtool_revertprocessedimfile.sql"); 384 390 if (!query) { 385 391 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 386 return false; 387 } 388 389 if (config->where) { 390 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "rawImfile"); 392 psFree(where); 393 return false; 394 } 395 396 if (psListLength(where->list)) { 397 psString whereClause = psDBGenerateWhereConditionSQL(where, "rawImfile"); 391 398 psStringAppend(&query, " AND %s", whereClause); 392 399 psFree(whereClause); 393 400 } 401 psFree(where); 394 402 395 403 if (!p_psDBRunQuery(config->dbh, query)) { … … 413 421 PS_ASSERT_PTR_NON_NULL(config, false); 414 422 423 psMetadata *where = psMetadataAlloc(); 424 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 425 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 426 415 427 PXOPT_LOOKUP_S16(code, config->args, "-code", true, false); 416 428 417 if (!pxSetFaultCode(config->dbh, "rawImfile", config->where, code)) {429 if (!pxSetFaultCode(config->dbh, "rawImfile", where, code)) { 418 430 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 419 return false; 420 } 431 psFree (where); 432 return false; 433 } 434 psFree (where); 421 435 422 436 return true; … … 511 525 512 526 // optional 527 PXOPT_LOOKUP_TIME(dateobs, config->args, "-dateobs", false, false); 528 PXOPT_LOOKUP_STR(exp_type, config->args, "-exp_type", false, false); 529 PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", false, false); 513 530 PXOPT_LOOKUP_STR(dvodb, config->args, "-dvodb", false, false); 514 531 PXOPT_LOOKUP_STR(tess_id, config->args, "-tess_id", false, false); 515 532 PXOPT_LOOKUP_STR(end_stage, config->args, "-end_stage", false, false); 516 PXOPT_LOOKUP_STR(exp_type, config->args, "-exp_type", false, false);517 PXOPT_LOOKUP_STR(workdir, config->args, "-workdir", false, false);518 533 PXOPT_LOOKUP_STR(reduction, config->args, "-reduction", false, false); 519 534 PXOPT_LOOKUP_STR(filter, config->args, "-filter", false, false); … … 561 576 PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); 562 577 PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false); 563 PXOPT_LOOKUP_TIME(dateobs, config->args, "-dateobs", false, false);564 578 565 579 // default … … 789 803 PS_ASSERT_PTR_NON_NULL(config, false); 790 804 791 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);792 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);793 PXOPT_LOOKUP_BOOL(faulted, config->args, "-faulted", false);794 795 805 psString query = pxDataGet("regtool_processedexp.sql"); 796 806 if (!query) { … … 812 822 PXOPT_COPY_STR(config->args, where, "-reduction", "reduction", "=="); 813 823 PXOPT_COPY_STR(config->args, where, "-filter", "filter", "=="); 814 PXOPT_COPY_F 64(config->args, where, "-airmass_min", "airmass", ">=");815 PXOPT_COPY_F 64(config->args, where, "-airmass_max", "airmass", "<");824 PXOPT_COPY_F32(config->args, where, "-airmass_min", "airmass", ">="); 825 PXOPT_COPY_F32(config->args, where, "-airmass_max", "airmass", "<"); 816 826 PXOPT_COPY_F64(config->args, where, "-ra_min", "ra", ">="); 817 827 PXOPT_COPY_F64(config->args, where, "-ra_max", "ra", "<"); … … 832 842 PXOPT_COPY_F64(config->args, where, "-az_min", "az", ">="); 833 843 PXOPT_COPY_F64(config->args, where, "-az_max", "az", "<"); 834 PXOPT_COPY_F 32(config->args, where, "-ccd_temp_min", "ccd_temp", ">=");835 PXOPT_COPY_F 32(config->args, where, "-ccd_temp_max", "ccd_temp", "<");844 PXOPT_COPY_F64(config->args, where, "-ccd_temp_min", "ccd_temp", ">="); 845 PXOPT_COPY_F64(config->args, where, "-ccd_temp_max", "ccd_temp", "<"); 836 846 PXOPT_COPY_F64(config->args, where, "-posang_min", "posang", ">="); 837 847 PXOPT_COPY_F64(config->args, where, "-posang_max", "posang", "<"); … … 839 849 PXOPT_COPY_F32(config->args, where, "-solang_min", "solang", ">="); 840 850 PXOPT_COPY_F32(config->args, where, "-solang_max", "solang", "<"); 851 852 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 853 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 854 PXOPT_LOOKUP_BOOL(faulted, config->args, "-faulted", false); 841 855 842 856 if (psListLength(where->list)) { … … 906 920 PS_ASSERT_PTR_NON_NULL(config, false); 907 921 922 psMetadata *where = psMetadataAlloc(); 923 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 924 PXOPT_COPY_S16(config->args, where, "-code", "fault", "=="); 925 908 926 psString query = pxDataGet("regtool_revertprocessedexp.sql"); 909 927 if (!query) { 910 928 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 911 return false; 912 } 913 914 if (config->where) { 915 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "rawExp"); 929 psFree(where); 930 return false; 931 } 932 933 if (psListLength(where->list)) { 934 psString whereClause = psDBGenerateWhereConditionSQL(where, "rawExp"); 916 935 psStringAppend(&query, " AND %s", whereClause); 936 psFree(where); 917 937 psFree(whereClause); 918 938 } 939 psFree(where); 919 940 920 941 if (!p_psDBRunQuery(config->dbh, query)) { … … 938 959 PS_ASSERT_PTR_NON_NULL(config, false); 939 960 961 psMetadata *where = psMetadataAlloc(); 962 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 963 940 964 PXOPT_LOOKUP_S16(code, config->args, "-code", true, false); 941 965 942 if (!pxSetFaultCode(config->dbh, "rawExp", config->where, code)) {966 if (!pxSetFaultCode(config->dbh, "rawExp", where, code)) { 943 967 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 944 return false; 945 } 968 psFree(where); 969 return false; 970 } 971 psFree(where); 946 972 947 973 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
