14 string hd_msg = opts.
optMap[
"LOG_MSG"].args +
" MYSQL mirrors Factory: >> ";
17 map<string, mirror*> mymirs;
24 QSqlDatabase db =
openGdb(opts);
31 if(it->second.get_factory() !=
"MYSQL")
35 cout << hd_msg <<
" Initializing " << it->second.get_factory() <<
" for detector " << it->first << endl;
38 string dname = it->first ;
39 string tname = dname +
"__mirrors";
44 string dbexecute =
"select name, desc, type, finish, model, border, maptOptProps, photonEnergy, indexOfRefraction, reflectivity, efficiency, specularlobe, specularspike, backscatter from " + tname;
45 dbexecute +=
" where variation ='" + variation +
"'";
49 if(!q.exec(dbexecute.c_str()))
51 cout << hd_msg <<
" Failed to execute MYSQL query " << dbexecute <<
". This is a fatal error. Exiting." << endl;
52 qDebug() << q.lastError();
58 cout <<
" ** WARNING: mirror for system \"" << dname <<
"\" not found with variation \"" << variation << endl << endl;
78 mymirs[thisMir->
name] = thisMir;
int check_if_factory_is_needed(map< string, detectorCondition > dcon, string factory)
void closeGdb(QSqlDatabase db)
QSqlDatabase openGdb(goptions gemcOpt)
string get_variation(string var)
parse variation name from string
string qv_tostring(QVariant input)
void opticalsFromString(string, string)
Overloaded "<<" for mirror class. Dumps infos on screen.
map< string, detectorCondition > detectorConditionsMap
map< string, aopt > optMap
Options map.
map< string, mirror * > initMirrors(runConditions, goptions)
void printMirrors(map< string, mirror * > mirMap)
bool is_main_variation(string var)
returns 1 if the string "main:" is found on the input
string TrimSpaces(string in)
Removes leading and trailing spaces.