aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2010-05-04 06:51:48 -0700
committerThomas White <taw@bitwiz.org.uk>2010-05-04 06:51:48 -0700
commite3501a93626954a499b1a38e33011d36fb11129b (patch)
tree4d0c25e1e1c1bf4a1a9c2b6f8ca1370979209622 /src
parent1c7cb5afd975e4d57d3e7fe242a0aaae8f6b01a4 (diff)
process_hkl: Add progress bar
More advanced merging methods make it slow... :(
Diffstat (limited to 'src')
-rw-r--r--src/process_hkl.c17
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);