ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/applications/staticProps/StaticPropsCmd.c
(Generate patch)

Comparing trunk/OOPSE-4/src/applications/staticProps/StaticPropsCmd.c (file contents):
Revision 2701 by gezelter, Tue Apr 11 15:33:27 2006 UTC vs.
Revision 2763 by xsun, Mon May 22 15:30:42 2006 UTC

# Line 44 | Line 44 | void clear_given (struct gengetopt_args_info *args_inf
44    args_info->output_given = 0 ;
45    args_info->step_given = 0 ;
46    args_info->nrbins_given = 0 ;
47 +  args_info->nbins_x_given = 0 ;
48 +  args_info->nbins_y_given = 0 ;
49    args_info->nanglebins_given = 0 ;
50    args_info->length_given = 0 ;
51    args_info->zoffset_given = 0 ;
# Line 63 | Line 65 | void clear_given (struct gengetopt_args_info *args_inf
65    args_info->scd_given = 0 ;
66    args_info->density_given = 0 ;
67    args_info->slab_density_given = 0 ;
68 +  args_info->hxy_given = 0 ;
69    args_info->staticProps_group_counter = 0 ;
70   }
71  
# Line 77 | Line 80 | void clear_args (struct gengetopt_args_info *args_info
80    args_info->step_orig = NULL;
81    args_info->nrbins_arg = 100;
82    args_info->nrbins_orig = NULL;
83 +  args_info->nbins_x_arg = 100;
84 +  args_info->nbins_x_orig = NULL;
85 +  args_info->nbins_y_arg = 100;
86 +  args_info->nbins_y_orig = NULL;
87    args_info->nanglebins_arg = 50;
88    args_info->nanglebins_orig = NULL;
89    args_info->length_orig = NULL;
# Line 114 | Line 121 | cmdline_parser_print_help (void)
121    printf("%s\n","  -o, --output=filename         output file name");
122    printf("%s\n","  -n, --step=INT                process every n frame  (default=`1')");
123    printf("%s\n","  -r, --nrbins=INT              number of bins for distance  (default=`100')");
124 +  printf("%s\n","  -x, --nbins_x=INT             number of bins in x axis  (default=`100')");
125 +  printf("%s\n","  -y, --nbins_y=INT             number of bins in y axis  (default=`100')");
126    printf("%s\n","  -a, --nanglebins=INT          number of bins for cos(angle)  (default=`50')");
127    printf("%s\n","  -l, --length=DOUBLE           maximum length (Defaults to 1/2 smallest length \n                                  of first frame)");
128    printf("%s\n","  -z, --zoffset=DOUBLE          Where to set the zero for the slab_density \n                                  calculation  (default=`0')");
# Line 134 | Line 143 | cmdline_parser_print_help (void)
143    printf("%s\n","      --scd                     scd order parameter(either --sele1, --sele2, \n                                  --sele3 are specified or --molname, --begin, \n                                  --end are specified)");
144    printf("%s\n","      --density                 density plot (--sele1 must be specified)");
145    printf("%s\n","      --slab_density            slab density (--sele1 must be specified)");
146 +  printf("%s\n","      --hxy                     hxy (--sele1 must be specified)");
147    
148   }
149  
# Line 178 | Line 188 | cmdline_parser_release (struct gengetopt_args_info *ar
188        free (args_info->nrbins_orig); /* free previous argument */
189        args_info->nrbins_orig = 0;
190      }
191 +  if (args_info->nbins_x_orig)
192 +    {
193 +      free (args_info->nbins_x_orig); /* free previous argument */
194 +      args_info->nbins_x_orig = 0;
195 +    }
196 +  if (args_info->nbins_y_orig)
197 +    {
198 +      free (args_info->nbins_y_orig); /* free previous argument */
199 +      args_info->nbins_y_orig = 0;
200 +    }
201    if (args_info->nanglebins_orig)
202      {
203        free (args_info->nanglebins_orig); /* free previous argument */
# Line 303 | Line 323 | cmdline_parser_file_save(const char *filename, struct
323        fprintf(outfile, "%s=\"%s\"\n", "nrbins", args_info->nrbins_orig);
324      } else {
325        fprintf(outfile, "%s\n", "nrbins");
326 +    }
327 +  }
328 +  if (args_info->nbins_x_given) {
329 +    if (args_info->nbins_x_orig) {
330 +      fprintf(outfile, "%s=\"%s\"\n", "nbins_x", args_info->nbins_x_orig);
331 +    } else {
332 +      fprintf(outfile, "%s\n", "nbins_x");
333      }
334    }
335 +  if (args_info->nbins_y_given) {
336 +    if (args_info->nbins_y_orig) {
337 +      fprintf(outfile, "%s=\"%s\"\n", "nbins_y", args_info->nbins_y_orig);
338 +    } else {
339 +      fprintf(outfile, "%s\n", "nbins_y");
340 +    }
341 +  }
342    if (args_info->nanglebins_given) {
343      if (args_info->nanglebins_orig) {
344        fprintf(outfile, "%s=\"%s\"\n", "nanglebins", args_info->nanglebins_orig);
# Line 402 | Line 436 | cmdline_parser_file_save(const char *filename, struct
436    if (args_info->slab_density_given) {
437      fprintf(outfile, "%s\n", "slab_density");
438    }
439 +  if (args_info->hxy_given) {
440 +    fprintf(outfile, "%s\n", "hxy");
441 +  }
442    
443    fclose (outfile);
444  
# Line 450 | Line 487 | reset_group_staticProps(struct gengetopt_args_info *ar
487    args_info->scd_given = 0 ;
488    args_info->density_given = 0 ;
489    args_info->slab_density_given = 0 ;
490 +  args_info->hxy_given = 0 ;
491  
492    args_info->staticProps_group_counter = 0;
493   }
# Line 543 | Line 581 | cmdline_parser_internal (int argc, char * const *argv,
581          { "output",     1, NULL, 'o' },
582          { "step",       1, NULL, 'n' },
583          { "nrbins",     1, NULL, 'r' },
584 +        { "nbins_x",    1, NULL, 'x' },
585 +        { "nbins_y",    1, NULL, 'y' },
586          { "nanglebins", 1, NULL, 'a' },
587          { "length",     1, NULL, 'l' },
588          { "zoffset",    1, NULL, 'z' },
# Line 562 | Line 602 | cmdline_parser_internal (int argc, char * const *argv,
602          { "scd",        0, NULL, 0 },
603          { "density",    0, NULL, 0 },
604          { "slab_density",       0, NULL, 0 },
605 +        { "hxy",        0, NULL, 0 },
606          { NULL, 0, NULL, 0 }
607        };
608  
609        stop_char = 0;
610 <      c = getopt_long (argc, argv, "hVi:o:n:r:a:l:z:", long_options, &option_index);
610 >      c = getopt_long (argc, argv, "hVi:o:n:r:x:y:a:l:z:", long_options, &option_index);
611  
612        if (c == -1) break;       /* Exit from `while (1)' loop.  */
613  
# Line 656 | Line 697 | cmdline_parser_internal (int argc, char * const *argv,
697            if (args_info->nrbins_orig)
698              free (args_info->nrbins_orig); /* free previous string */
699            args_info->nrbins_orig = gengetopt_strdup (optarg);
700 +          break;
701 +
702 +        case 'x':       /* number of bins in x axis.  */
703 +          if (local_args_info.nbins_x_given)
704 +            {
705 +              fprintf (stderr, "%s: `--nbins_x' (`-x') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
706 +              goto failure;
707 +            }
708 +          if (args_info->nbins_x_given && ! override)
709 +            continue;
710 +          local_args_info.nbins_x_given = 1;
711 +          args_info->nbins_x_given = 1;
712 +          args_info->nbins_x_arg = strtol (optarg, &stop_char, 0);
713 +          if (!(stop_char && *stop_char == '\0')) {
714 +            fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
715 +            goto failure;
716 +          }
717 +          if (args_info->nbins_x_orig)
718 +            free (args_info->nbins_x_orig); /* free previous string */
719 +          args_info->nbins_x_orig = gengetopt_strdup (optarg);
720            break;
721  
722 +        case 'y':       /* number of bins in y axis.  */
723 +          if (local_args_info.nbins_y_given)
724 +            {
725 +              fprintf (stderr, "%s: `--nbins_y' (`-y') option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
726 +              goto failure;
727 +            }
728 +          if (args_info->nbins_y_given && ! override)
729 +            continue;
730 +          local_args_info.nbins_y_given = 1;
731 +          args_info->nbins_y_given = 1;
732 +          args_info->nbins_y_arg = strtol (optarg, &stop_char, 0);
733 +          if (!(stop_char && *stop_char == '\0')) {
734 +            fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg);
735 +            goto failure;
736 +          }
737 +          if (args_info->nbins_y_orig)
738 +            free (args_info->nbins_y_orig); /* free previous string */
739 +          args_info->nbins_y_orig = gengetopt_strdup (optarg);
740 +          break;
741 +
742          case 'a':       /* number of bins for cos(angle).  */
743            if (local_args_info.nanglebins_given)
744              {
# Line 1005 | Line 1086 | cmdline_parser_internal (int argc, char * const *argv,
1086                continue;
1087              local_args_info.slab_density_given = 1;
1088              args_info->slab_density_given = 1;
1089 +            if (args_info->staticProps_group_counter && override)
1090 +              reset_group_staticProps (args_info);
1091 +            args_info->staticProps_group_counter += 1;
1092 +            break;
1093 +          }
1094 +          /* hxy (--sele1 must be specified).  */
1095 +          else if (strcmp (long_options[option_index].name, "hxy") == 0)
1096 +          {
1097 +            if (local_args_info.hxy_given)
1098 +              {
1099 +                fprintf (stderr, "%s: `--hxy' option given more than once%s\n", argv[0], (additional_error ? additional_error : ""));
1100 +                goto failure;
1101 +              }
1102 +            if (args_info->hxy_given && ! override)
1103 +              continue;
1104 +            local_args_info.hxy_given = 1;
1105 +            args_info->hxy_given = 1;
1106              if (args_info->staticProps_group_counter && override)
1107                reset_group_staticProps (args_info);
1108              args_info->staticProps_group_counter += 1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines