Changeset 543ce4 for molecuilder/src/periodentafel.cpp
- Timestamp:
- Nov 4, 2009, 7:56:04 PM (16 years ago)
- Children:
- 4ef101, aa8542
- Parents:
- ec70ec
- File:
-
- 1 edited
-
molecuilder/src/periodentafel.cpp (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/periodentafel.cpp
rec70ec r543ce4 13 13 #include "helpers.hpp" 14 14 #include "lists.hpp" 15 #include "log.hpp" 15 16 #include "periodentafel.hpp" 16 17 #include "verbose.hpp" … … 47 48 pointer->sort = &pointer->Z; 48 49 if (pointer->Z < 1 && pointer->Z >= MAX_ELEMENTS) 49 cout<< Verbose(0) << "Invalid Z number!\n";50 Log() << Verbose(0) << "Invalid Z number!\n"; 50 51 return add(pointer, end); 51 52 }; … … 102 103 int Z; 103 104 do { 104 cout<< Verbose(0) << "Atomic number Z: ";105 Log() << Verbose(0) << "Atomic number Z: "; 105 106 cin >> Z; 106 107 walker = this->FindElement(Z); // give type … … 116 117 element *walker = NULL; 117 118 int Z = -1; 118 cout<< Verbose(0) << "Atomic number: " << Z << endl;119 Log() << Verbose(0) << "Atomic number: " << Z << endl; 119 120 cin >> Z; 120 121 walker = FindElement(Z); 121 122 if (walker == NULL) { 122 cout<< Verbose(0) << "Element not found in database, please enter." << endl;123 Log() << Verbose(0) << "Element not found in database, please enter." << endl; 123 124 walker = new element; 124 125 walker->Z = Z; 125 cout<< Verbose(0) << "Mass: " << endl;126 Log() << Verbose(0) << "Mass: " << endl; 126 127 cin >> walker->mass; 127 cout<< Verbose(0) << "Name [max 64 chars]: " << endl;128 Log() << Verbose(0) << "Name [max 64 chars]: " << endl; 128 129 cin >> walker->name; 129 cout<< Verbose(0) << "Short form [max 3 chars]: " << endl;130 Log() << Verbose(0) << "Short form [max 3 chars]: " << endl; 130 131 cin >> walker->symbol; 131 132 periodentafel::AddElement(walker); … … 196 197 infile.getline(header1, MAXSTRINGSIZE); 197 198 infile.getline(header2, MAXSTRINGSIZE); // skip first two header lines 198 cout<< "Parsed elements:";199 Log() << Verbose(0) << "Parsed elements:"; 199 200 while (!infile.eof()) { 200 201 element *neues = new element; … … 218 219 //infile >> ws; 219 220 infile >> ws; 220 cout<< " " << neues->symbol;221 Log() << Verbose(0) << " " << neues->symbol; 221 222 //neues->Output((ofstream *)&cout); 222 223 if ((neues->Z > 0) && (neues->Z < MAX_ELEMENTS)) 223 224 periodentafel::AddElement(neues); 224 225 else { 225 cout<< "Could not parse element: ";226 Log() << Verbose(0) << "Could not parse element: "; 226 227 neues->Output((ofstream *)&cout); 227 228 delete(neues); 228 229 } 229 230 } 230 cout<< endl;231 Log() << Verbose(0) << endl; 231 232 infile.close(); 232 233 infile.clear(); … … 245 246 infile >> FindElement((int)tmp)->Valence; 246 247 infile >> ws; 247 // cout<< Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->Valence << " valence electrons." << endl;248 //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->Valence << " valence electrons." << endl; 248 249 } 249 250 infile.close(); … … 263 264 infile >> FindElement((int)tmp)->NoValenceOrbitals; 264 265 infile >> ws; 265 // cout<< Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->NoValenceOrbitals << " number of singly occupied valence orbitals." << endl;266 //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->NoValenceOrbitals << " number of singly occupied valence orbitals." << endl; 266 267 } 267 268 infile.close(); … … 284 285 infile >> ptr->HBondDistance[2]; 285 286 infile >> ws; 286 // cout<< Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->HBondDistance[0] << " Angstrom typical distance to hydrogen." << endl;287 //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->HBondDistance[0] << " Angstrom typical distance to hydrogen." << endl; 287 288 } 288 289 infile.close(); … … 305 306 infile >> ptr->HBondAngle[2]; 306 307 infile >> ws; 307 // cout<< Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->HBondAngle[0] << ", " << FindElement((int)tmp)->HBondAngle[1] << ", " << FindElement((int)tmp)->HBondAngle[2] << " degrees bond angle for one, two, three connected hydrogens." << endl;308 //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->HBondAngle[0] << ", " << FindElement((int)tmp)->HBondAngle[1] << ", " << FindElement((int)tmp)->HBondAngle[2] << " degrees bond angle for one, two, three connected hydrogens." << endl; 308 309 } 309 310 infile.close(); … … 312 313 313 314 if (!otherstatus) 314 cerr<< "WARNING: Something went wrong while parsing the other databases!" << endl;315 eLog() << Verbose(0) << "WARNING: Something went wrong while parsing the other databases!" << endl; 315 316 316 317 return status;
Note:
See TracChangeset
for help on using the changeset viewer.
