Changeset 31397
- Timestamp:
- Apr 27, 2011, 8:03:07 PM (15 years ago)
- Location:
- branches/czw_branch/20110406/ippTools/src
- Files:
-
- 2 edited
-
laptool.c (modified) (20 diffs)
-
laptoolConfig.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20110406/ippTools/src/laptool.c
r31396 r31397 15 15 #include "laptool.h" 16 16 17 18 // Sequence level 19 static bool definesequenceMode(pxConfig *config); 20 static bool listsequenceMode(pxConfig *config); 17 21 18 22 // Run level … … 21 25 static bool updaterunMode(pxConfig *config); 22 26 // Exposure level 23 static bool pendingchipexpMode(pxConfig *config); 24 static bool pendingquickstackMode(pxConfig *config); 25 static bool pendingdiffMode(pxConfig *config); 26 static bool pendingfinalstackMode(pxConfig *config); 27 static bool pendingexpMode(pxConfig *config); 28 static bool exposuresMode(pxConfig *config); 29 static bool stacksMode(pxConfig *config); 27 30 static bool updateexpMode(pxConfig *config); 31 32 static bool inactiveexpMode(pxConfig *config); 28 33 29 34 # define MODECASE(caseName, func) \ … … 105 110 psError(PS_ERR_UNKNOWN, false, "database error"); 106 111 } 107 psError(PS_ERR_UNKNOWN, false "database error");112 psError(PS_ERR_UNKNOWN, false, "database error"); 108 113 psFree(run); 109 114 return(true); … … 140 145 psString query = pxDataGet("laptool_listsequence.sql"); 141 146 if (!query) { 142 psError(PXTOOL _ERR_SYS, false, "failed to retrieve SQL statement");147 psError(PXTOOLS_ERR_SYS, false, "failed to retrieve SQL statement"); 143 148 return false; 144 149 } … … 151 156 if (limit) { 152 157 psString limitString = psDBGenerateLimitSQL(limit); 153 psStringAppend(&query, " %s" limitString);158 psStringAppend(&query, " %s", limitString); 154 159 psFree(limitString); 155 160 } … … 209 214 PXOPT_LOOKUP_STR(label, config->args, "-label", false, false); 210 215 PXOPT_LOOKUP_STR(dist_group, config->args, "-dist_group", false, false); 216 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 211 217 212 218 lapRunRow *run = lapRunRowAlloc(0, // lap_id … … 220 226 NULL, // registered 221 227 0, // fault 222 NULL,// quick_sass_id223 NULL,// final_sass_id228 0, // quick_sass_id 229 0 // final_sass_id 224 230 ); 225 231 if (!run) { … … 233 239 } 234 240 235 if (!lap SequenceInsertObject(config->dbh, run)) {241 if (!lapRunInsertObject(config->dbh, run)) { 236 242 if (!psDBRollback(config->dbh)) { 237 243 psError(PS_ERR_UNKNOWN, false, "database error"); 238 244 } 239 psError(PS_ERR_UNKNOWN, false "database error");245 psError(PS_ERR_UNKNOWN, false, "database error"); 240 246 psFree(run); 241 247 return(true); … … 248 254 } 249 255 250 if (lap SequencePrintObject(stdout, run, !simple)) {256 if (lapRunPrintObject(stdout, run, !simple)) { 251 257 psError(PS_ERR_UNKNOWN, false, "failed to print object"); 252 258 psFree(run); … … 259 265 psString query = pxDataGet("laptool_definerun.sql"); 260 266 if (!query) { 261 psError(PXTOOL _ERR_SYS, false, "failed to retrieve SQL statement");267 psError(PXTOOLS_ERR_SYS, false, "failed to retrieve SQL statement"); 262 268 return(false); 263 269 } … … 292 298 for (long i = 0; i < output->n; i++) { 293 299 psMetadata *row = output->data[i]; // Row from select 294 bool status; 295 lapExpRow *reExp = lapExpObjectFromMetadata(row); 296 reExp->lap_id = lap_id; 297 298 if (!lapExpInsertObject(config->dbh,reExp)) { 300 lapExpRow *lapExp = lapExpObjectFromMetadata(row); 301 lapExp->lap_id = lap_id; 302 303 if (!lapExpInsertObject(config->dbh,lapExp)) { 299 304 if (!psDBRollback(config->dbh)) { 300 305 psError(PS_ERR_UNKNOWN, false, "database error"); … … 302 307 psError(PS_ERR_UNKNOWN, false, "database error"); 303 308 psFree(output); 304 psFree( reExp);309 psFree(lapExp); 305 310 return(false); 306 311 } … … 328 333 psString query = pxDataGet("laptool_pendingrun.sql"); 329 334 if (!query) { 330 psError(PXTOOL _ERR_SYS, false, "failed to retrieve SQL statement");335 psError(PXTOOLS_ERR_SYS, false, "failed to retrieve SQL statement"); 331 336 return false; 332 337 } … … 433 438 psString query = pxDataGet("laptool_pendingexp.sql"); 434 439 if (!query) { 435 psError(PXTOOL _ERR_SYS, false, "failed to retrieve SQL statement");440 psError(PXTOOLS_ERR_SYS, false, "failed to retrieve SQL statement"); 436 441 return false; 437 442 } … … 444 449 if (limit) { 445 450 psString limitString = psDBGenerateLimitSQL(limit); 446 psStringAppend(&query, " %s" limitString);451 psStringAppend(&query, " %s", limitString); 447 452 psFree(limitString); 448 453 } … … 500 505 psString query = pxDataGet("laptool_exposures.sql"); 501 506 if (!query) { 502 psError(PXTOOL _ERR_SYS, false, "failed to retrieve SQL statement");507 psError(PXTOOLS_ERR_SYS, false, "failed to retrieve SQL statement"); 503 508 return(false); 504 509 } … … 557 562 psString query = pxDataGet("laptool_stacks.sql"); 558 563 if (!query) { 559 psError(PXTOOL _ERR_SYS, false, "failed to retrieve SQL statement");564 psError(PXTOOLS_ERR_SYS, false, "failed to retrieve SQL statement"); 560 565 return(false); 561 566 } … … 614 619 PXOPT_LOOKUP_S64(set_chip_id, config->args, "-set_chip_id", false, false); 615 620 PXOPT_LOOKUP_S64(set_pair_id, config->args, "-set_pair_id", false, false); 616 PXOPT_LOOKUP_BOOL(private, config->args, "-private", false , false);617 PXOPT_LOOKUP_BOOL(public, config->args, "-public", false , false);618 PXOPT_LOOKUP_BOOL(pairwise, config->args, "-pairwise", false , false);619 PXOPT_LOOKUP_BOOL(nopairwise, config->args, "-nopairwise", false , false);620 PXOPT_LOOKUP_BOOL(active, config->args, "-active", false , false);621 PXOPT_LOOKUP_BOOL(inactive, config->args, "-inactive", false , false);621 PXOPT_LOOKUP_BOOL(private, config->args, "-private", false); 622 PXOPT_LOOKUP_BOOL(public, config->args, "-public", false); 623 PXOPT_LOOKUP_BOOL(pairwise, config->args, "-pairwise", false); 624 PXOPT_LOOKUP_BOOL(nopairwise, config->args, "-nopairwise", false); 625 PXOPT_LOOKUP_BOOL(active, config->args, "-active", false); 626 PXOPT_LOOKUP_BOOL(inactive, config->args, "-inactive", false); 622 627 623 628 … … 632 637 } 633 638 634 psMetadata *where = psMetadataAlloc();635 639 PXOPT_COPY_S64(config->args, where, "-lap_id", "lap_id", "=="); 636 640 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); … … 687 691 psString query = pxDataGet("laptool_inactiveexp.sql"); 688 692 if (!query) { 689 psError(PXTOOL _ERR_SYS, false, "failed to retrieve SQL statement");693 psError(PXTOOLS_ERR_SYS, false, "failed to retrieve SQL statement"); 690 694 return(false); 691 695 } -
branches/czw_branch/20110406/ippTools/src/laptoolConfig.c
r31396 r31397 12 12 #include <psmodules.h> 13 13 #include "pxtools.h" 14 #include " regtool.h"14 #include "laptool.h" 15 15 16 16 #define ADD_OPT(TYPE,TARG,NAME,COMMENT,DEFAULT) psMetadataAdd##TYPE(TARG, PS_LIST_TAIL, NAME, 0, COMMENT, DEFAULT) … … 74 74 ADD_OPT(S16, updaterunArgs, "-fault", "set fault code", INT16_MAX); 75 75 ADD_OPT(Str, updaterunArgs, "-set_label", "set label", NULL); 76 ADD_OPT(S64, updaterunArgs, "-set_quick_sass_id", "set quick stack sass_id", NAN);77 ADD_OPT(S64, updaterunArgs, "-set_final_sass_id", "set final stack sass_id", NAN);76 ADD_OPT(S64, updaterunArgs, "-set_quick_sass_id", "set quick stack sass_id", 0); 77 ADD_OPT(S64, updaterunArgs, "-set_final_sass_id", "set final stack sass_id", 0); 78 78 79 79
Note:
See TracChangeset
for help on using the changeset viewer.
