- Timestamp:
- Jan 11, 2012, 11:19:21 PM (15 years ago)
- Location:
- branches/meh_branches/ppsub_test
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
ippTools/src (modified) (2 props)
-
ippTools/src/chiptool.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/meh_branches/ppsub_test
- Property svn:mergeinfo changed
-
branches/meh_branches/ppsub_test/ippTools/src
- Property svn:ignore
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20110710/ippTools/src (added) merged: 32337 /branches/eam_branches/ipp-20110906/ippTools/src (added) merged: 32630 /branches/eam_branches/ipp-20111110/ippTools/src (added) merged: 32694 /branches/haf_add201112/ippTools/src (added) merged: 32980,32986,33003,33023,33027
-
branches/meh_branches/ppsub_test/ippTools/src/chiptool.c
r31954 r33098 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); … … 883 885 } 884 886 psFree(query); 887 int numDeleted = psDBAffectedRows(config->dbh); 888 psLogMsg("chiptool", PS_LOG_INFO, "Deleted %d chipProcessedImfiles", numDeleted); 885 889 886 890 if (!fault) { … … 896 900 } 897 901 psFree(query_update); 902 int numUpdated = psDBAffectedRows(config->dbh); 903 psLogMsg("chiptool", PS_LOG_INFO, "Updated %d chipProcessedImfiles", numUpdated); 904 898 905 899 906 return true; … … 962 969 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 963 970 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 964 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, NULL);971 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 965 972 if (psListLength(where->list) == 0) { 966 973 psError(PS_ERR_UNKNOWN, true, "search parameters are required"); … … 986 993 987 994 995 return true; 996 } 997 998 // "drop" previously processed components as though the original processing 999 // had poor quality. Sets quality, data_state, clears fault and magicked 1000 // Deletes corresponding magicDSFile (if one exists) 1001 static bool dropprocessedimfileMode(pxConfig *config) 1002 { 1003 PS_ASSERT_PTR_NON_NULL(config, false); 1004 1005 psMetadata *where = psMetadataAlloc(); 1006 PXOPT_COPY_S64(config->args, where, "-chip_id", "chipProcessedImfile.chip_id", "=="); 1007 PXOPT_COPY_STR(config->args, where, "-class_id", "chipProcessedImfile.class_id", "=="); 1008 PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", true, false); 1009 PXOPT_LOOKUP_S64(class_id, config->args, "-class_id", true, false); 1010 PXOPT_LOOKUP_S16(quality, config->args, "-set_quality", true, false); 1011 1012 if (!quality) { 1013 psError(PXTOOLS_ERR_CONFIG, true, "non-zero quality value is required"); 1014 return false; 1015 } 1016 1017 if (psListLength(where->list) == 0) { 1018 // won't get here 1019 psError(PXTOOLS_ERR_CONFIG, true, "-chip_id and -class_id are required"); 1020 return false; 1021 } 1022 1023 psString query = pxDataGet("chiptool_dropprocessedimfile_update.sql"); 1024 if (!query) { 1025 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 1026 return false; 1027 } 1028 psString delete_query = pxDataGet("chiptool_dropprocessedimfile_delete.sql"); 1029 if (!delete_query) { 1030 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 1031 return false; 1032 } 1033 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 1034 psStringAppend(&query, " WHERE %s", whereClause); 1035 psFree(where); 1036 1037 if (!psDBTransaction(config->dbh)) { 1038 psError(PS_ERR_UNKNOWN, false, "database error"); 1039 return false; 1040 } 1041 if (!p_psDBRunQueryF(config->dbh, query, quality)) { 1042 if (!psDBRollback(config->dbh)) { 1043 psError(PS_ERR_UNKNOWN, false, "database error on rollback"); 1044 } 1045 psError(PS_ERR_UNKNOWN, false, "database error"); 1046 psFree(query); 1047 return false; 1048 } 1049 psFree(query); 1050 1051 psStringAppend(&delete_query, " AND %s", whereClause); 1052 psFree(whereClause); 1053 if (!p_psDBRunQuery(config->dbh, delete_query)) { 1054 if (!psDBRollback(config->dbh)) { 1055 psError(PS_ERR_UNKNOWN, false, "database error on rollback"); 1056 } 1057 psError(PS_ERR_UNKNOWN, false, "database error"); 1058 psFree(delete_query); 1059 return false; 1060 } 1061 psFree(delete_query); 1062 1063 if (!psDBCommit(config->dbh)) { 1064 psError(PS_ERR_UNKNOWN, false, "database error"); 1065 return false; 1066 } 988 1067 return true; 989 1068 } … … 1418 1497 psMetadata *where = psMetadataAlloc(); 1419 1498 pxAddLabelSearchArgs (config, where, "-label", "label", "=="); 1420 1499 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 1421 1500 // look for completed chipPendingExp 1422 1501 // migrate them to chipProccessedExp & camPendingExp … … 1432 1511 psFree(whereClause); 1433 1512 } 1513 1514 psTrace("chiptool", 10, "%s\n", query); 1434 1515 psFree(where); 1435 1516
Note:
See TracChangeset
for help on using the changeset viewer.
