Changeset 7299
- Timestamp:
- Jun 2, 2006, 11:26:36 AM (20 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
dettool.c (modified) (4 diffs)
-
dettoolConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r7293 r7299 100 100 { 101 101 bool status = false; 102 psString str = NULL;103 102 104 103 PS_ASSERT_PTR_NON_NULL(config, false); 104 105 // what type of detRun is this? 106 psString det_type = psMetadataLookupStr(&status, config->args, "-det_type"); 107 // this flag is required 108 if (!det_type) { 109 psError(PS_ERR_UNKNOWN, true, "-det_type is required"); 110 return false; 111 } 105 112 106 113 // start a transaction so we don't end up with orphaned det_ids … … 109 116 return false; 110 117 } 111 112 // what type of detRun is this?113 // XXX make this flag required114 psString det_type = psMetadataLookupStr(&status, config->args, "-det_type");115 118 detRunInsert(config->dbh, det_type); 116 119 long det_id = psDBLastInsertID(config->dbh); … … 120 123 psMetadata *where = psMetadataAlloc(); 121 124 122 // was more then one exp_id specified? 125 // make sure that -exp_id was parsed correctly 126 // XXX this can be removed someday 123 127 if (item->type == PS_DATA_METADATA_MULTI) { 124 // yes125 128 psListIterator *iter = psListIteratorAlloc(item->data.list, 0, false); 126 129 psMetadataItem *mItem = NULL; 127 130 while ((mItem = psListGetAndIncrement(iter))) { 128 131 psString exp_id = mItem->data.V; 132 // if exp_id is NULL then it means that -exp_id has not specified 133 if (!exp_id) { 134 psError(PS_ERR_UNKNOWN, true, 135 "at least one -exp_id is required"); 136 // rollback 137 if (!psDBRollback(config->dbh)) { 138 psError(PS_ERR_UNKNOWN, false, "database error"); 139 } 140 psFree(where); 141 return false; 142 } 143 129 144 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 130 145 PS_META_DUPLICATE_OK, "==", exp_id)) { … … 139 154 } 140 155 } 141 } else if ((str = psMetadataLookupStr(&status, config->args, "-exp_id"))) { 142 // no 143 if (!psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", str)) { 144 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 145 // rollback 146 if (!psDBRollback(config->dbh)) { 147 psError(PS_ERR_UNKNOWN, false, "database error"); 148 } 149 psFree(where); 150 return false; 151 } 156 } else { 157 // rollback 158 if (!psDBRollback(config->dbh)) { 159 psError(PS_ERR_UNKNOWN, false, "database error"); 160 } 161 psAbort(config->argv[0], 162 "-exp_id was not parsed correctly (this should not happen"); 152 163 } 153 164 -
trunk/ippTools/src/dettoolConfig.c
r7293 r7299 24 24 psMetadata *defineArgs = psMetadataAlloc(); 25 25 psMetadataAddStr(defineArgs, PS_LIST_TAIL, "-exp_id", PS_META_DUPLICATE_OK, 26 "include this exposure ( XXX more then one)", NULL);26 "include this exposure (multiple OK, required)", NULL); 27 27 psMetadataAddStr(defineArgs, PS_LIST_TAIL, "-det_type", 0, 28 "define the type of detrend run ", NULL);28 "define the type of detrend run (required)", NULL); 29 29 30 30 // -runs
Note:
See TracChangeset
for help on using the changeset viewer.
