Changeset 27391 for trunk/ippTools/src/chiptool.c
- Timestamp:
- Mar 22, 2010, 1:58:02 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/chiptool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/chiptool.c
r27195 r27391 59 59 static bool importrunMode(pxConfig *config); 60 60 static bool runstateMode(pxConfig *config); 61 static bool setimfiletoupdateMode(pxConfig *config); 61 62 62 63 # define MODECASE(caseName, func) \ … … 101 102 MODECASE(CHIPTOOL_MODE_IMPORTRUN, importrunMode); 102 103 MODECASE(CHIPTOOL_MODE_RUNSTATE, runstateMode); 104 MODECASE(CHIPTOOL_MODE_SETIMFILETOUPDATE, setimfiletoupdateMode); 103 105 default: 104 106 psAbort("invalid option (this should not happen)"); … … 428 430 return false; 429 431 } 430 psString query = psStringCopy("UPDATE chipRun JOIN rawExp USING(exp_id) ");432 psString query = psStringCopy("UPDATE chipRun JOIN rawExp USING(exp_id) -- join hook %s\n"); 431 433 432 434 // pxUpdateRun gets parameters from config->args and updates 433 bool result = pxUpdateRun(config, where, &query, "chipRun", true);435 bool result = pxUpdateRun(config, where, &query, "chipRun", "chip_id", "chipProcessedImfile", true); 434 436 if (!result) { 435 437 psError(psErrorCodeLast(), false, "pxUpdateRun failed"); … … 1720 1722 return true; 1721 1723 } 1724 1725 // a very specfic function to queue a cleaned chipProcessedImfile to be updated 1726 static bool setimfiletoupdateMode(pxConfig *config) 1727 { 1728 PS_ASSERT_PTR_NON_NULL(config, NULL); 1729 1730 PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", true, false); 1731 PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", false, false); 1732 PXOPT_LOOKUP_STR(label, config->args, "-set_label", false, false); 1733 1734 psString query = pxDataGet("chiptool_setimfiletoupdate.sql"); 1735 if (!query) { 1736 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 1737 return false; 1738 } 1739 1740 psString setHook = psStringCopy(""); 1741 if (label) { 1742 psStringAppend(&setHook, "\n , chipRun.label = '%s'", label); 1743 } 1744 1745 if (class_id) { 1746 psStringAppend(&query, " AND (chipProcessedImfile.class_id = '%s')", class_id); 1747 } 1748 1749 if (!p_psDBRunQueryF(config->dbh, query, setHook, chip_id)) { 1750 psError(PS_ERR_UNKNOWN, false, "database error"); 1751 return false; 1752 } 1753 1754 psFree(setHook); 1755 psFree(query); 1756 1757 return true; 1758 }
Note:
See TracChangeset
for help on using the changeset viewer.
