- Timestamp:
- Nov 8, 2011, 2:44:12 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110906
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ippTools/src (modified) (1 prop)
-
ippTools/src/chiptool.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110906
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20110906/ippTools/src
- Property svn:mergeinfo changed
/trunk/ippTools/src (added) merged: 32421-32422,32445,32451,32469,32479,32482,32485,32511,32520,32532,32551,32565,32573,32575,32577,32593,32609
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20110906/ippTools/src/chiptool.c
r31954 r32630 43 43 static bool revertprocessedimfileMode(pxConfig *config); 44 44 static bool updateprocessedimfileMode(pxConfig *config); 45 static bool dropprocessedimfileMode(pxConfig *config); 45 46 static bool advanceexpMode(pxConfig *config); 46 47 static bool blockMode(pxConfig *config); … … 88 89 MODECASE(CHIPTOOL_MODE_REVERTPROCESSEDIMFILE, revertprocessedimfileMode); 89 90 MODECASE(CHIPTOOL_MODE_UPDATEPROCESSEDIMFILE, updateprocessedimfileMode); 91 MODECASE(CHIPTOOL_MODE_DROPPROCESSEDIMFILE, dropprocessedimfileMode); 90 92 MODECASE(CHIPTOOL_MODE_ADVANCEEXP, advanceexpMode); 91 93 MODECASE(CHIPTOOL_MODE_BLOCK, blockMode); … … 962 964 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 963 965 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 964 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, NULL);966 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 965 967 if (psListLength(where->list) == 0) { 966 968 psError(PS_ERR_UNKNOWN, true, "search parameters are required"); … … 986 988 987 989 990 return true; 991 } 992 993 // "drop" previously processed components as though the original processing 994 // had poor quality. Sets quality, data_state, clears fault and magicked 995 // Deletes corresponding magicDSFile (if one exists) 996 static bool dropprocessedimfileMode(pxConfig *config) 997 { 998 PS_ASSERT_PTR_NON_NULL(config, false); 999 1000 psMetadata *where = psMetadataAlloc(); 1001 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipProcessedImfile.chip_id", "=="); 1002 PXOPT_COPY_STR(config->args, where, "-class_id", "chipProcessedImfile.class_id", "=="); 1003 PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", true, false); 1004 PXOPT_LOOKUP_S64(class_id, config->args, "-class_id", true, false); 1005 PXOPT_LOOKUP_S16(quality, config->args, "-set_quality", true, false); 1006 1007 if (!quality) { 1008 psError(PXTOOLS_ERR_CONFIG, true, "non-zero quality value is required"); 1009 return false; 1010 } 1011 1012 if (psListLength(where->list) == 0) { 1013 // won't get here 1014 psError(PXTOOLS_ERR_CONFIG, true, "-chip_id and -class_id are required"); 1015 return false; 1016 } 1017 1018 psString query = pxDataGet("chiptool_dropprocessedimfile_update.sql"); 1019 if (!query) { 1020 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 1021 return false; 1022 } 1023 psString delete_query = pxDataGet("chiptool_dropprocessedimfile_delete.sql"); 1024 if (!delete_query) { 1025 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 1026 return false; 1027 } 1028 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 1029 psStringAppend(&query, " WHERE %s", whereClause); 1030 psFree(where); 1031 1032 if (!psDBTransaction(config->dbh)) { 1033 psError(PS_ERR_UNKNOWN, false, "database error"); 1034 return false; 1035 } 1036 if (!p_psDBRunQueryF(config->dbh, query, quality)) { 1037 if (!psDBRollback(config->dbh)) { 1038 psError(PS_ERR_UNKNOWN, false, "database error on rollback"); 1039 } 1040 psError(PS_ERR_UNKNOWN, false, "database error"); 1041 psFree(query); 1042 return false; 1043 } 1044 psFree(query); 1045 1046 psStringAppend(&delete_query, " AND %s", whereClause); 1047 psFree(whereClause); 1048 if (!p_psDBRunQuery(config->dbh, delete_query)) { 1049 if (!psDBRollback(config->dbh)) { 1050 psError(PS_ERR_UNKNOWN, false, "database error on rollback"); 1051 } 1052 psError(PS_ERR_UNKNOWN, false, "database error"); 1053 psFree(delete_query); 1054 return false; 1055 } 1056 psFree(delete_query); 1057 1058 if (!psDBCommit(config->dbh)) { 1059 psError(PS_ERR_UNKNOWN, false, "database error"); 1060 return false; 1061 } 988 1062 return true; 989 1063 } … … 1418 1492 psMetadata *where = psMetadataAlloc(); 1419 1493 pxAddLabelSearchArgs (config, where, "-label", "label", "=="); 1420 1494 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 1421 1495 // look for completed chipPendingExp 1422 1496 // migrate them to chipProccessedExp & camPendingExp … … 1432 1506 psFree(whereClause); 1433 1507 } 1508 1509 psTrace("chiptool", 10, "%s\n", query); 1434 1510 psFree(where); 1435 1511
Note:
See TracChangeset
for help on using the changeset viewer.
