diff options
author | Thomas White <taw@bitwiz.org.uk> | 2010-05-04 06:51:48 -0700 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2010-05-04 06:51:48 -0700 |
commit | e3501a93626954a499b1a38e33011d36fb11129b (patch) | |
tree | 4d0c25e1e1c1bf4a1a9c2b6f8ca1370979209622 /src | |
parent | 1c7cb5afd975e4d57d3e7fe242a0aaae8f6b01a4 (diff) |
process_hkl: Add progress bar
More advanced merging methods make it slow... :(
Diffstat (limited to 'src')
-rw-r--r-- | src/process_hkl.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/process_hkl.c b/src/process_hkl.c index 8e14d331..08dba4ac 100644 --- a/src/process_hkl.c +++ b/src/process_hkl.c @@ -330,6 +330,20 @@ int main(int argc, char *argv[]) return 1; } + /* Count the number of patterns in the file */ + n_total_patterns = 0; + do { + char line[1024]; + + rval = fgets(line, 1023, fh); + if ( (strncmp(line, "Reflections from indexing", 25) == 0) + || (strncmp(line, "New pattern", 11) == 0) ) { + n_total_patterns++; + } + } while ( rval != NULL ); + rewind(fh); + STATUS("There are %i patterns to process\n", n_total_patterns); + n_patterns = 0; do { @@ -363,6 +377,9 @@ int main(int argc, char *argv[]) zero_list_count(new_counts); n_patterns++; + + progress_bar(n_patterns, n_total_patterns, "Merging"); + } r = sscanf(line, "%i %i %i %f", &h, &k, &l, &intensity); |