From e3501a93626954a499b1a38e33011d36fb11129b Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 4 May 2010 06:51:48 -0700 Subject: process_hkl: Add progress bar More advanced merging methods make it slow... :( --- src/process_hkl.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/process_hkl.c') 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); -- cgit v1.2.3