Skip to content
Snippets Groups Projects
Commit 1c6a127e authored by Jan Reher's avatar Jan Reher
Browse files

Extension of apdUnitCreator

parent 703c269f
No related branches found
No related tags found
2 merge requests!4Many proven updates being brought into stable branch.,!3Commented in the lines in apdUnitCreator.cpp that do the actual database
Pipeline #1597 failed with stages
in 2 seconds
......@@ -30,24 +30,29 @@ void processArgumentsAndQueryMissing(int m_argc, char* m_argv[]);
void loadSerialsFromFileName(string m_fileName, bool m_debug = false);
int main(int argc, char* argv[]) {
ProductionDatabaseClient *proddb = new ProductionDatabaseClient();
processArgumentsAndQueryMissing(argc, argv);
ProductionDatabaseClient *proddb = new ProductionDatabaseClient();
if (debug) cout << "Intitialized apdBoxSetter with version " << proddb->getVersion() << " of the database access libraries." << endl << endl
<< "Now trying to set Batch number " << boxNo << " for ADPs from serial file " << fileName << endl;
loadSerialsFromFileName(fileName);
// if (username == "" || password == "") proddb->queryCredentials();
// else proddb->setCredentials(username, password);
// DatabaseClientResponse response = proddb->checkConnectivityAndCredentials();
// if (response != Successful ) {
// cerr << "Connection to database failed because of error: " << response << endl;
// return response;
// }
// if (debug) cout << "Connection successful!" << endl;
if (username == "" || password == "") proddb->queryCredentials();
else proddb->setCredentials(username, password);
DatabaseClientResponse response = proddb->checkConnectivityAndCredentials();
if (response != Successful ) {
cerr << "Connection to database failed because of error: " << response << endl;
return response;
}
if (debug) cout << "Connection successful!" << endl;
for (auto newUnit = newUnits.begin(); newUnit < newUnits.end(); newUnit++) {
//proddb->createApdCapsule(newUnit->redSerial, newUnit->blueSerial);
std::string capsuleSerial = newUnit->redSerial + "/" + newUnit->blueSerial;
std::cerr << "Capsule serial should be " << capsuleSerial << std::endl;
//proddb->createApdUnit(capsuleSerial, newUnit->crystalSerial, newUnit->barCode);
}
// cout << "\nBox " << boxNo << " was successfully assigned to APDs from serial file " << fileName << ". At least I hope so. In any case, something happened for " << apdSerials.size() << " APDs."
// << "\nThank you for using apdBoxSetter! :)" << endl << endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment