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

Added program to query the batch (before and after irradiation) of a list of APDs.

parent 847e5d5a
No related branches found
No related tags found
No related merge requests found
// Basic
#include <fstream>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
// Boost
#include <boost/program_options.hpp>
// Custom
#include "ProdDbAccess.h"
#include "toolbox.cpp"
using namespace std;
namespace po = boost::program_options;
static string fileName = "serials.dat";
int main(int argc, char* argv[]) {
if ( argc < 2 ) {
cerr << "ERROR: Missing parameters! Please provide the name of a text file containing the serials needed." << endl;
exit(1);
}
if ( argc > 2 ) {
cerr << "ERROR: Too many parameters! Please only provide the name of a text file containing the serials needed." << endl;
exit(1);
}
ProdDbAccess* _dba = new ProdDbAccess();
fileName = string(argv[1]);
vector<string> apdSerials = loadSerialsFromFileName(fileName);
for (size_t i = 0 ; i < apdSerials.size() ; i++ ) {
if (apdSerials[i].size() == 9) apdSerials[i] = "0" + apdSerials[i];
cout << "S/N: " << apdSerials[i] << " New: " << _dba->getBatchNew( uint( stoul( apdSerials[i] ) ) ) << " Old: " << _dba->getBatchIrr( uint( stoul( apdSerials[i] ) ) ) << endl;
}
return 0;
}
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