Changeset f5306f for molecuilder/src/builder.cpp
- Timestamp:
- Apr 29, 2008, 6:30:38 AM (17 years ago)
- Children:
- dac5c5
- Parents:
- 661288
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/builder.cpp
r661288 rf5306f 748 748 char *ConfigFileName = NULL; 749 749 char *ElementsFileName = NULL; 750 int flag = 1;750 int flag = 0; 751 751 int Z; 752 752 int j, axis, count, faktor; … … 773 773 case 'H': 774 774 case '?': 775 flag=2; 775 776 cout << "MoleCuilder suite" << endl << "==================" << endl << endl; 776 777 cout << "Usage: " << argv[0] << "[-{acepsthH?vfrp}] [further arguments] [config file]" << endl; … … 785 786 cout << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl; 786 787 cout << "\t-v/-V\t\tGives version information." << endl; 787 return 0;788 cout << "Note: config files must not begin with '-' !" << endl; 788 789 break; 789 790 case 'v': 790 791 case 'V': 792 flag=2; 791 793 cout << argv[0] << " " << VERSIONSTRING << endl; 792 794 cout << "Build your own molecule position set." << endl; 793 return 0;794 795 break; 795 796 case 'e': … … 827 828 } 828 829 } else { 830 test.close(); 829 831 ConfigFileName = argv[argc-1]; 830 832 cout << Verbose(1) << "Specified config file found, parsing ..."; 831 switch (configuration.TestSyntax( &test, periode, mol)) {833 switch (configuration.TestSyntax(ConfigFileName, periode, mol)) { 832 834 case 1: 833 835 cout << "new syntax." << endl; 834 configuration.Load( &test, periode, mol);836 configuration.Load(ConfigFileName, periode, mol); 835 837 config_present = present; 836 838 break; 837 839 case 0: 838 840 cout << "old syntax." << endl; 839 configuration.LoadOld( &test, periode, mol);841 configuration.LoadOld(ConfigFileName, periode, mol); 840 842 config_present = present; 841 843 break; … … 844 846 config_present = empty; 845 847 } 846 test.close();847 848 } 848 849 } else … … 856 857 switch(argv[argptr-1][1]) { 857 858 case 'p': 859 flag = 1; 858 860 cout << Verbose(1) << "Parsing xyz file for new atoms." << endl; 859 861 if (!mol->AddXYZFile(argv[argptr++])) … … 871 873 switch(argv[argptr-1][1]) { 872 874 case 't': 875 flag = 1; 873 876 cout << Verbose(1) << "Translating all ions to new origin." << endl; 874 877 for (int i=0;i<3;i++) … … 878 881 break; 879 882 case 'a': 883 flag = 1; 880 884 cout << Verbose(1) << "Adding new atom." << endl; 881 885 first = new atom; … … 894 898 break; 895 899 case 's': 900 flag = 1; 896 901 j = -1; 897 902 cout << Verbose(1) << "Scaling all ion positions by factor." << endl; … … 914 919 break; 915 920 case 'c': 921 flag = 1; 916 922 j = -1; 917 923 cout << Verbose(1) << "Centering atoms in config file within given additional boundary." << endl; … … 930 936 break; 931 937 case 'r': 938 flag = 1; 932 939 cout << Verbose(1) << "Converting config file from supposed old to new syntax." << endl; 933 940 break; 934 941 case 'f': 935 942 int i,j; 936 flag = 0;943 flag = 1; 937 944 if (argc > argptr+3) { 938 945 cout << Verbose(0) << "Creating connection matrix..." << endl; … … 998 1005 } else argptr++; 999 1006 } while (argptr < (argc-1)); 1000 if (flag )1007 if (flag == 1) // 1 means save and exit 1001 1008 SaveConfig(ConfigFileName, &configuration, periode, mol); 1002 delete(mol); 1003 delete(periode); 1004 return (0); 1009 if (flag > 1) { // 2 means just exit 1010 delete(mol); 1011 delete(periode); 1012 return (0); 1013 } 1005 1014 } 1006 1015
Note:
See TracChangeset
for help on using the changeset viewer.