Changeset 11024
- Timestamp:
- Jan 10, 2007, 6:42:52 PM (19 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 4 edited
-
camtool.c (modified) (5 diffs)
-
camtool.h (modified) (1 diff)
-
camtoolConfig.c (modified) (4 diffs)
-
chiptool.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/camtool.c
r10944 r11024 30 30 static bool pendingimfileMode(pxConfig *config); 31 31 static bool addprocessedexpMode(pxConfig *config); 32 static bool faultexpMode(pxConfig *config); 32 33 static bool blockMode(pxConfig *config); 33 34 static bool maskedMode(pxConfig *config); … … 51 52 MODECASE(P3TOOL_MODE_PENDINGIMFILE, pendingimfileMode); 52 53 MODECASE(P3TOOL_MODE_ADDPROCESSEDEXP, addprocessedexpMode); 54 MODECASE(P3TOOL_MODE_FAULTEXP, faultexpMode); 53 55 MODECASE(P3TOOL_MODE_BLOCK, blockMode); 54 56 MODECASE(P3TOOL_MODE_MASKED, maskedMode); … … 76 78 { 77 79 PS_ASSERT_PTR_NON_NULL(config, false); 80 81 bool status = false; 82 psU64 limit = psMetadataLookupU64(&status, config->args, "-limit"); 83 if (!status) { 84 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -limit"); 85 return false; 86 } 87 88 bool faulted = psMetadataLookupU64(&status, config->args, "-faulted"); 89 if (!status) { 90 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -faulted"); 91 return false; 92 } 78 93 79 94 psString query = psStringCopy( … … 97 112 psStringAppend(&query, " %s", whereClause); 98 113 psFree(whereClause); 114 } 115 116 if (faulted) { 117 // list only faulted rows 118 psStringAppend(&query, " %s", "AND p3PendingExp.fault != 0"); 119 } else { 120 // don't list faulted rows 121 psStringAppend(&query, " %s", "AND p3PendingExp.fault = 0"); 122 } 123 124 // treat limit == 0 as "no limit" 125 if (limit) { 126 psString limitString = psDBGenerateLimitSQL(limit); 127 psStringAppend(&query, " %s", limitString); 128 psFree(limitString); 99 129 } 100 130 … … 390 420 } 391 421 422 423 static bool faultexpMode(pxConfig *config) 424 { 425 PS_ASSERT_PTR_NON_NULL(config, false); 426 427 bool status = false; 428 psS8 code = psMetadataLookupS8(&status, config->args, "-code"); 429 if (!status) { 430 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code"); 431 return false; 432 } 433 434 if (!pxSetFaultCode(config->dbh, "p3PendingExp", config->where, code)) { 435 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 436 return false; 437 } 438 439 return true; 440 } 441 442 392 443 static bool blockMode(pxConfig *config) 393 444 { -
trunk/ippTools/src/camtool.h
r9790 r11024 28 28 P3TOOL_MODE_PENDINGIMFILE, 29 29 P3TOOL_MODE_ADDPROCESSEDEXP, 30 P3TOOL_MODE_FAULTEXP, 30 31 P3TOOL_MODE_BLOCK, 31 32 P3TOOL_MODE_MASKED, -
trunk/ippTools/src/camtoolConfig.c
r10440 r11024 49 49 psMetadataAddS32(pendingexpArgs, PS_LIST_TAIL, "-p3_version", 0, 50 50 "search for exposures with this p3 version", -1); 51 psMetadataAddU64(pendingexpArgs, PS_LIST_TAIL, "-limit", 0, 52 "limit result set to N items", 0); 53 psMetadataAddBool(pendingexpArgs, PS_LIST_TAIL, "-faulted", 0, 54 "only return imfiles with a fault status set", false); 51 55 psMetadataAddBool(pendingexpArgs, PS_LIST_TAIL, "-simple", 0, 52 56 "use the simple output format", false); 57 53 58 54 59 // -pendingimfile … … 93 98 "define banana 2", NULL); 94 99 100 // -faultexp 101 psMetadata *faultexpArgs = psMetadataAlloc(); 102 psMetadataAddStr(faultexpArgs, PS_LIST_TAIL, "-exp_tag", 0, 103 "search by exposure ID", NULL); 104 psMetadataAddStr(faultexpArgs, PS_LIST_TAIL, "-class", 0, 105 "search by class", NULL); 106 psMetadataAddStr(faultexpArgs, PS_LIST_TAIL, "-class_id", 0, 107 "search by class ID", NULL); 108 psMetadataAddS8(faultexpArgs, PS_LIST_TAIL, "-code", 0, 109 "set fault code (required)", 0); 110 95 111 // -block 96 112 psMetadata *blockArgs = psMetadataAlloc(); … … 128 144 psMetadata *argSets = psMetadataAlloc(); 129 145 // find which mode we're running under 130 PXTOOL_MODE("-pendingexp", P3TOOL_MODE_PENDINGEXP, pendingexpArgs); 131 PXTOOL_MODE("-pendingimfile",P3TOOL_MODE_PENDINGIMFILE,pendingimfileArgs); 146 PXTOOL_MODE("-pendingexp", P3TOOL_MODE_PENDINGEXP, pendingexpArgs); 147 PXTOOL_MODE("-pendingimfile",P3TOOL_MODE_PENDINGIMFILE, pendingimfileArgs); 148 PXTOOL_MODE("-faultexp", P3TOOL_MODE_FAULTEXP, faultexpArgs); 132 149 PXTOOL_MODE("-addprocessedexp", P3TOOL_MODE_ADDPROCESSEDEXP, addprocessedexpArgs); 133 PXTOOL_MODE("-block", P3TOOL_MODE_BLOCK, blockArgs);134 PXTOOL_MODE("-masked", P3TOOL_MODE_MASKED, maskedArgs);135 PXTOOL_MODE("-unblock", P3TOOL_MODE_UNBLOCK, unblockArgs);150 PXTOOL_MODE("-block", P3TOOL_MODE_BLOCK, blockArgs); 151 PXTOOL_MODE("-masked", P3TOOL_MODE_MASKED, maskedArgs); 152 PXTOOL_MODE("-unblock", P3TOOL_MODE_UNBLOCK, unblockArgs); 136 153 137 154 bool argErr = false; … … 210 227 addWhereStr(filter); 211 228 212 if ( config->where->list->n< 1) {229 if (psListLength(config->where->list) < 1) { 213 230 psFree(config->where); 214 231 config->where = NULL; -
trunk/ippTools/src/chiptool.c
r11002 r11024 768 768 pendingExp->p1_version, 769 769 pendingExp->p2_version, 770 pendingExp->label 770 pendingExp->label, 771 0 // fault code 771 772 ); 772 773 }
Note:
See TracChangeset
for help on using the changeset viewer.
